[PHP] trying to get a certain num of rows in mysql

2002-10-13 Thread Pablo Oliva

When doing a select query, is there any way to specify which rows you
want selected, as in rows 1 through 40, and then 40 - 80 on the next
query.  I've been searching through the manual but can't find anything.
Should this be done through a php script instead, or is there a native
(mysql) command/clause for this?



[PHP] Predefined variables not set?

2002-10-13 Thread Miles

When trying to get $_SERVER[QUERY_STRING] I am getting 'Undefined index 
QUERY_STRING' error

If there is a query string, e.g.  www.site.com/index.php?hello_world then it IS 
defined.  So it seems that PHP is complaining about undefined variables, rather than 
just outputting nothing.

How can I fix this?  I've had no problems until i reinstalled php today...

Cheers,

Miles



[PHP] Upload Problem

2002-10-13 Thread tony

I posted User Upload and with no advice I attempted to use the sources i
could find and came up with the following:

while (file_exists($i.tab)) {
$i ++;
}
$destfile = $i;
$destfile .= tab;
stripslashes($userfile);
copy($userfile, /uploads/ . $destfile);
chdir(/uploads);
$lines = file($destfile);
$content = implode(br, $lines);
unlink($destfile);
echo($userfile_name);

It doesnt work (surprise, surprise), what im trying to do is upload the file
to my /uploads/ directory then read it and store it on the $content
variable, then the content variable inserts a row into db (allready done),
then I delete the file the while loop is to make sure I dont overwrite the
file and make an error in my database.

The errors PHP returns are:

Warning: Unable to open 'C:\\My Documents\\lyrics\\C_DTBS\\SLIME.TXT' for
reading: No such file or directory in /home/tabzilla/public_html/doadd.php
on line 89

Warning: ChDir: No such file or directory (errno 2) in
/home/tabzilla/public_html/doadd.php on line 90

Warning: file(tab) - No such file or directory in
/home/tabzilla/public_html/doadd.php on line 91

Warning: Bad arguments to implode() in /home/tabzilla/public_html/doadd.php
on line 92

Warning: unlink() failed (No such file or directory) in
/home/tabzilla/public_html/doadd.php on line 93


ANY HELP? ANYONE???


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] A little help needed, I cant figure!

2002-10-13 Thread Randum Ian

Morning all,

I am currently working on a project for my client that involves an
archive of Artist Singles and Album charts dating from the 1960's to the
current day. I would like to be able to put them into a database but I
am unsure of which database to use (I don't mind learning one if it
proves to be better) or how to layout the tables within the database.

For example I intend to have over 4,000 different charts covering well
over 6,000 artists and over 26,000 singles and album titles. Could mySQL
and PHP cope with this demand?

I thought about having a table for Artists, one for Singles and then one
for Albums and a junction table coupling all of them together but I
can't figure out how to do it.

Has anybody got any thoughts that could help me along the way?

Kind regards,
Randum Ian
[EMAIL PROTECTED]
DJ / Reviewer / Webmaster, DancePortal (UK) Limited 
DancePortal.co.uk - Global dance music media



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] trying to get a certain num of rows in mysql

2002-10-13 Thread Marek Kilimajer

Look for LIMIT in the manual

Pablo Oliva wrote:

When doing a select query, is there any way to specify which rows you
want selected, as in rows 1 through 40, and then 40 - 80 on the next
query.  I've been searching through the manual but can't find anything.
Should this be done through a php script instead, or is there a native
(mysql) command/clause for this?

  



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] A little help needed, I cant figure!

2002-10-13 Thread John W. Holmes

[snip]
 For example I intend to have over 4,000 different charts covering well
 over 6,000 artists and over 26,000 singles and album titles. Could
mySQL
 and PHP cope with this demand?

Yes, easily. Make sure your tables are properly indexed. 

 I thought about having a table for Artists, one for Singles and then
one
 for Albums and a junction table coupling all of them together but I
 can't figure out how to do it.
 
 Has anybody got any thoughts that could help me along the way?

Table one would be the artists. Here you could store their name, age,
etc. They would be assigned an ID to relate to their albums and songs. 

Artists Table:
Artist_id
Name
Age
Hometown
...

Table two would be an album table where you would list the albums name,
release date, etc. It would be related back to the artist of the album
by the artist_id. You wouldn't have to store number of songs here,
because you can count them out of the next table.

Album Table:
Album_id
Artist_id
Name
Release_date
...

This table would hold the songs off the albums and the singles. You
would use type to designate if the song is a single or off an album. If
it's off an album, then a_id would be the album_id that relates back to
the album and artist. If it's a single, then a_id would be the artist_id
of who had the single. 

Song Table:
Song_id
A_id
Type
Name
Length
Lyrics
...

That's my ideas on how to do it. There are many ways to do it, though.

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] newline in string

2002-10-13 Thread John W. Holmes

 I have loaded an html file into a string.  How can I search the string
for
 newlines/linefeeds? I know they are there, because if I echo the
string
 and
 view source in the browser, some tags are on new lines.
 
 Example:
 html
 
 head
 /head

And do what when you find them? If you just want to know if there are
newlines in the file, then use strstr(). If you want to remove or
replace them, then use str_replace(). If you want to add in a br where
some newlines are, then use nl2br().

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] getimagesize() with ftp-url?

2002-10-13 Thread Stefan Wessman

Hi!

Can anyone tell me if the getimagesize() function is supposed to work with
ftp-url's?
The PHP Manual states URL support was added in PHP 4.0.5, but maby that is
supposed to mean http-url's only?

The following is an expample of how i would like to be able to use
getimagesize():

?php
$size =
getimagesize(ftp://user:[EMAIL PROTECTED]/pictures/image.jpg;);

echo 'pre';
print_r($size);
echo '/pre';
?

This code yields the following errors in my log:

[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(): php_hostconnect:
connect failed in getimagesize.php on line 2
[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(...): failed to create
stream: FTP server reports 227 Entering Passive Mode (194.236.xxx.xxx in
getimagesize.php on line 2

Is this a bug, or is it a missing feature, or maby a documentation issue?
I've tried it on a few different ftp-servers, so i don't think that is the
problem.. but who knows?

Any thoghts would be appreciated.

/OnionMan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] trying to get a certain num of rows in mysql

2002-10-13 Thread Timothy J Hitchens

Look at limit... eg Select * from xyz limit 1,5


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-Original Message-
From: Pablo Oliva [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, 13 October 2002 8:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] trying to get a certain num of rows in mysql


When doing a select query, is there any way to specify which rows you
want selected, as in rows 1 through 40, and then 40 - 80 on the next
query.  I've been searching through the manual but can't find anything.
Should this be done through a php script instead, or is there a native
(mysql) command/clause for this?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] =.jpg from another URL with PHP=

2002-10-13 Thread Anthony Ritter

Thanks to all for your respones to my inquiry.

I placed the PHP script to open the .jpg from another URL in another file
and then inserted the HTML IMG tag to reference that file.   The result
was that it outputted a small sqaure with a red x  - but no image of the
map.

Any advice would be greatly appreciated.

Tony Ritter

The scripts follow...
...

HTML
HEAD
SCRIPT LANGUAGE=JavaScript
function findTheAnswer()
 {
  var number_one=window.document.the_form.field_one.value;
  var product=Math.round(9/5* number_one + 32);
  alert(The water temperature is  + product +  degrees fahrenheit);
  document.the_form.field_one.value=
  document.the_form.field_one.focus()
 }
/SCRIPT

?
function getUSGS($data, $station)
 {
$data;
$content = file($data);
array_pop($content);
$current = array_pop($content);
$newcurrent = explode(\t,$current);
print(table border=1 ALIGN=CENTER);
print(trtd bgcolor=\#FF\Font Face=\arial\ size
=1$station/Font/tdtd bgcolor=\#FF\Font Face=\arial\ size
=1Station/Font/tdtd bgcolor=\#FF\Font Face=\arial\ size
=1Date and Time/Font/tdtd bgcolor=\#FF\Font Face=\arial\
size =1Height/Font/tdtd bgcolor=\#FF\Font Face=\arial\ size
=1CFS/Font/tdtd bgcolor=\#FF\Font Face=\arial\ size
=1Temperature/Font/td/tr);
print(trtdFont Face=\arial\
size=1$newcurrent[0]/Font/tdtdFont Face=\arial\
size=1$newcurrent[1]/Font/tdtdFont Face=\arial\
size=1$newcurrent[2]/Font/tdtdFont Face=\arial\
size=1$newcurrent[3]/font/tdtdFont Face=\arial\
size=1$newcurrent[4]/font/tdtdFont Face=\arial\
size=1$newcurrent[5]/font/td/tr);
print(/table);
}
?

BODY
FONT FACE=arial SIZE=2
These tables represent real time data from the United States Geological
Survey.
The numbers will change every fifteen minutes to reflect the changes in
water temperatures
and water levels at the following stations in the Delaware River drainage.
Optimum water temperatures
for the following gamefish are listed below.
FONT FACE=arial SIZE=1
TABLE BORDER=0 ALIGN=CENTER
TRTD BGCOLOR=#FFE4C4FONT FACE=arial SIZE=1B r o w n  T r o u t
/FONT/TDTD BGCOLOR=#FFE4C4FONT FACE=arial SIZE=1R a i n b o w  T
r o u t /FONT/TDTD BGCOLOR=#FFE4C4FONT FACE=arial SIZE=1S h a d
/FONT/TDTD BGCOLOR=#FFE4C4FONT FACE=arial SIZE=1S m a l l m o u
t h  B a s s /FONT/TDTD BGCOLOR=#FFE4C4FONT FACE=arial SIZE=1W a
l l e y e /FONT/TD/TR
TRTDFONT FACE=arial SIZE=148 to 62 degrees/FONT/TDTDFONT
FACE=arial SIZE=154 to 68 degrees/FONT/TDTDFONT FACE=arial
SIZE=152 to 66 degrees/FONT/TDTDFONT FACE=arial SIZE=167 to 77
degrees/FONT/TDTDFONT FACE=arial SIZE=1Below 50
degrees/FONT/TD/TR
PBR
/TABLE
BR
/FONT


?
getUSGS(http://waterdata.usgs.gov/ny/nwis/uv?format=rdbperiod=1site_no=01
427510,Upper Delaware  River at Callicoon, NY);
print(P ALIGN=\CENTER\FONT FACE=\arial\ COLOR=\red\ SIZE=1Normal
water levels on the main stem are from 2.7 to 3.2 feet or 600 to 1500
cfs.BR/FONT);
print(FONT FACE=\arial\ COLOR=\red\ SIZE=1 ALIGN=\CENTER\Anglers
should use caution above 3.3 feet and the river is not wadable at 3.5 feet
and above./FONTBR);

getUSGS(http://waterdata.usgs.gov/ny/nwis/uv?format=rdbperiod=1site_no=01
426500,W. Br.  Delaware River at Hale Eddy, NY);

getUSGS(http://waterdata.usgs.gov/ny/nwis/uv?format=rdbperiod=1site_no=01
420500,Beaverkill River at  C o o k s F a l l s, NY);

getUSGS(http://waterdata.usgs.gov/ny/nwis/uv?format=rdbperiod=1site_no=01
427500, C a l l i c o o n  C r e e k  a t  Callicoon, NY);
?

FORM NAME=the_form
FONT FACE=arial SIZE=1 Enter  biCelsius/b/i  number here:/FONT
INPUT TYPE==text NAME=field_one size=3  nbsp;
a href = #  onClick=findTheAnswer(); return false;FONT FACE=arial
SIZE=1 Click this line to convert to Fahrenheit/A/FONT
/FORM

FONT FACE=arial SIZE =1Click A HREF=http://localhost/Map.php;
here/A for Real Time 600 mile Northeast Doppler Radar Map./FONT
P

/BODY
/HTML

..

// file:C:/ColorMap.php
// PHP script to open the .jpg file.


?
$theURL=http://image.weather.com/web/radar/us_har_closeradar_medium_usen.jp
g;
if(!($fp=fopen($theURL, r)))
 {
  print(Could not open the URL.);
  exit;
 }
$contents=fread($fp,100);
print($contents);
fclose($fp);
?

...


HTML
HEAD
BODY
This is a test.
IMG SRC=C:/ColorMap.php
/BODY
/HTML
// This page outputs: This is a test - with a small square and a red x - no
image of the map.
...



John W. Holmes wrote in message:

Make another file that has your code in it and sends an image/jpeg
header. Then insert the image like any other image:

img src='yourfile.php'

Hope you're not violating any copyrights...

---John Holmes...
..





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Upload Problem

2002-10-13 Thread Chris Hewitt

[EMAIL PROTECTED] wrote:


Warning: Unable to open 'C:\\My Documents\\lyrics\\C_DTBS\\SLIME.TXT' for
reading: 

Has the webserver got permission to read this file? It does not seem to 
be under the document root.

No such file or directory in /home/tabzilla/public_html/doadd.php
on line 89

Is line 89 in the code you posted, if so please mark it. I suggest 
echoing the value of any variables so that you can check that they 
contain exactly what you think they do.

Warning: Bad arguments to implode() in /home/tabzilla/public_html/doadd.php
on line 92

Possibly because the file was not opened/found.

HTH
Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] POST and GET variables don't work

2002-10-13 Thread Jennifer Swofford

BTW, disregard my comment about GET... I confused myself.  Zzz.

Jen


 Try:

 $_Post[name];

 or $HTTP_POST_VARS[name];

 In new PHP version, register_globals is set to off by default, which is
 why $name isn't working for you.  Although, I'm surprised GET isn't
 working

 Jen


  I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with
 
  configure --with-java --with-apxs=/usr/local/apache/bin/apx
 
  It's running with Apache 1.3.26
 
  PHP work ok, even Java works, but if I try to pass variables from a form
  with either POST or GET, the variables don't get through.  This is the
 code
  I'm using:
 
  index.html:
  ...
  form action=php.php method=post
   Name: input type=text name=namebr
input type=submit
/form
  ...
 
  php.php:
 
  ?php
  echo *;
  echo $name;
  echo *;
  ?
 
  The variable $name is always empty.  I tried this same scripts on the
RPM
  version installed with Mandrake 7.2 and it worked fine, so it shouldn't
be
  the scripts.  What could be wrong? Maybe I missed a ./configure option?
 
  Thanks in advance,
 
 
  Andres




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Predefined variables not set?

2002-10-13 Thread Chris Hewitt

Miles wrote:

than just outputting nothing.

How can I fix this?  I've had no problems until i reinstalled php today...

register_globals?

HTH
Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: php cgi question

2002-10-13 Thread David Cook

Just a quick addition, both the submit/link were very basic, they both
worked like this


$location = /cgi-bin/getmailtest.cgi;
// $location = getmail.php;
echo $locationbr;
print(a href=$locationClick here to test the cgi/abr\n);

print(form name=form1 method=post action=$location);
print(press the button to try the cgi as a redirect this waybr);
print(input type=submit value=\try it\);

(that was because I was messing round with differing locations of the cgi,
different extensions etc.. made it easier to set the actual cgi as a
variable, thats all)

Eventually if I can get this to work, it will have to accept a variable as
well being passed (the identifier), something like
getmailtest.cgi?id=$identifier

Thanks again

Hope someone can help

David Cook





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP in crontab job

2002-10-13 Thread Juhan Kundla

Ühel ilusal päeval [11-10-2002 20:48] kirjutas Sharat Hegde:
 Hello John,
 
 Thanks for the help. I was able to solve this. Thanks Marek for your help 
 too in giving the same solution.
 
 The problem was with the crontab command not having the full path to php. 
 Silly that a command line on the shell script should work but crontab is 
 unable to find the same path.

This is not silly, the cron simply does not have the environment
variables set. If you are using vixie cron, you can set the environment
within the crontab ie:

PATH=/bin:/usr/bin
[EMAIL PROTECTED]

* * * * * man cron

Cheers,
Juhan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] How to navigate backwards in PHP ???

2002-10-13 Thread John W. Holmes

Maybe keep a record in the session of the URLs the user has gone to.
Just don't store the URLs with a hash-mark in them. Store them as an
array and it'd be easy to make a back like by just using the next to
last or last element of the array...

---John Holmes...

 -Original Message-
 From: -[ Rene Brehmer ]- [mailto:[EMAIL PROTECTED]]
 Sent: Friday, October 11, 2002 8:59 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] How to navigate backwards in PHP ???
 
 This is really puzzling me ... I've tried finding the answer in the
manual
 ... but sofar without luck...
 
 What I need to is simply to be able to make a go-back link that points
to
 the URL that contains the page that had the link that send the user to
the
 current page ... (did that make sense?)
 
 Or to put it another way: I need to be able to have a link on page A,
 point to page B, and then have page B know the exact URL of page A
 (including all variables that's needed to build page A).
 
 The thing is that simply using a href=javascript:history.go(-1)
 doesn't work because the internal links adds the hash-mark (#) after
the
 URL, and then the browser needs to go one more step backwards for each
 time the user clicks on an internal link ...
 
 I could easily write a JS function to handle all of this, but my goal
is
 to not use any JS at all, and really, this is something that ought to
be
 easily doable in PHP ... only I can't figure out how ... does it have
 something like Document Referrer ??? which could contain the URL of
the
 sender, which I'd then be able to plump into a variable, which could
then
 be used when generating the links to go back to the sender page...
 
 TIA
 
 Rene
 --
 Rene Brehmer
 System developer in the making...
 
 This message was written on 100% recycled spam.
 
 My website: http://www.geocities.com/cerberus_hotdog
 Babes and computer  internet references...
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] User Upload

2002-10-13 Thread tony

How would I go about allowing a user to upload a file which I then read and
store its contents in a mysql database and then delete the file, or any more
efficient method.

Any help at all would be great.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: $html_code .= include (filetoinclude.txt);

2002-10-13 Thread CJ


$html_code = $html_code.include(filetoinclude.txt);


Research And Development wrote:
 Should this work?
 
 $html_code .= include (filetoinclude.txt);
 
 I am populating a variable with html to be printred later as usual: 
 $html_code .= html.
 
 But I have some static html files that I want included in the html that 
 I am storing in the variable. The HTML is in text files. The above code 
 obviously does not work. I want to know if there is another way.
 
 Thanks.
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: $html_code .= include (filetoinclude.txt);

2002-10-13 Thread Shawn McKenzie

function file_get_contents($filename) {
$fp = @fopen($filename, r);
 if (!($fp)) {
 return 0;
 }
 while (!feof($fp))  {
$temp .= fread($fp, 4096);
 }
 return $temp;
}

and then:  $html_code = file_get_contents(filetoinclude.txt);

HTH
-Shawn

Research And Development [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Should this work?

 $html_code .= include (filetoinclude.txt);

 I am populating a variable with html to be printred later as usual:
 $html_code .= html.

 But I have some static html files that I want included in the html that
 I am storing in the variable. The HTML is in text files. The above code
 obviously does not work. I want to know if there is another way.

 Thanks.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] POST and GET variables don't work

2002-10-13 Thread Oscar F

Most likely you have register_globals set to off on your php.ini. 
Change this to register_globals = on (or true, or yes, either one 
should).

If you dont want to do that, Try with $_GET['name'] or $_POST['name'].

HTH.

   Oscar F.-

Andres Olarte wrote:

 
 
 
 I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with
 
 configure --with-java --with-apxs=/usr/local/apache/bin/apx
 
 It's running with Apache 1.3.26
 
 PHP work ok, even Java works, but if I try to pass variables from a form 
 with either POST or GET, the variables don't get through.  This is the 
 code I'm using:
 
 index.html:
 ...
 form action=php.php method=post
 Name: input type=text name=namebr
  input type=submit
  /form
 ...
 
 php.php:
 
 ?php
 echo *;
 echo $name;
 echo *;
 ?
 
 The variable $name is always empty.  I tried this same scripts on the 
 RPM version installed with Mandrake 7.2 and it worked fine, so it 
 shouldn't be the scripts.  What could be wrong? Maybe I missed a 
 ./configure option?
 
 Thanks in advance,
 
 
 Andres
 
 
 
 _
 Únase al mayor servicio mundial de correo electrónico: 
 http://www.hotmail.com/es
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] User Upload

2002-10-13 Thread Stephen

There are many ways. I'd suggest setting up a folder where the user uploads
the file (using the FTP commands in PHP) then setting up some sort of admin
cp that gets a list of the files from the folder, displays them, then you
click it. If you like it or whatever, you can click a save link which copies
the contents and saves it into a MySQL table. The code would be too long to
put in for this list though...

Thanks,
Stephen Craton
http://www.melchior.us

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, October 12, 2002 11:31 AM
Subject: [PHP] User Upload


 How would I go about allowing a user to upload a file which I then read
and
 store its contents in a mysql database and then delete the file, or any
more
 efficient method.

 Any help at all would be great.


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] An small SQL problem

2002-10-13 Thread Davy Obdam

Hi Brad,

Oooops. I think i better go and  read your excelent book MySQL/PHP 
database applications agian..
Best regards,

Davy Obdam
mailto:[EMAIL PROTECTED]

Brad Bulger wrote:

what database are you using? because the answer is different, depending.

on postgres, for example, which supports subselects, you can do

select * from TableA where FieldA1 not in (select FieldB2 from TableB)

with mysql, there are no subselects, so you'd have to do something like

select TableA.*, TableB.FieldB1
from TableA left join TableB on TableA.FieldA1 = TableB.FieldB1
having FieldB1 is null

PS the one thing that for sure will not work is

select TableA.* from TableA, TableB where TableA.FieldA1 != TableB.FieldB2

that will just give you a cartesian product, returning a copy of
every row in TableA for every row in TableB that doesn't match its key

On Sat, 12 Oct 2002, Christian Ista wrote:

  

Hello,

I'm probably sleepy because I can't do a very easy query. :(

I have 2 tables TableA(FieldA1, FieldA2, FieldA3) and TableB(FieldB1,
FieldB2, FieldB3).

I'd like to see the TableA records (FieldA2) where the FieldA1(Primary
key) not exist in TableB(FieldB2). I tried not exists without success.

Could you help me ?

Christian,


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





  




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] html form array

2002-10-13 Thread Roger Thomas

try this (noticed that I've changed $foo to $_POST[foo]. after all we're
livin in globals off rite? )

?
if ($_POST[submit]) {
print submittedBR;
for($i=0;$isizeof($_POST[foo]);$i++) {
print $_POST[foo][$i].BR;
}
}
else {
?
form action=? echo $_SERVER[PHP_SELF] ? method=post
  input type=checkbox name=foo[] value=oneOne
  input type=checkbox name=foo[] value=twoTwo
  input type=checkbox name=foo[] value=threeThree
  input type=submit value=submit name=submit
/form
?
}
?

--
roger


--- John W. Holmes [EMAIL PROTECTED] wrote:
  dear all,
  i ran my code below on ie and it works. but when i use netscape 4.76
 under
  linux, i only get the
  message submitted even though i've checked some fields.
 
 The code is running on the same box, right? Just accessing it with
 different browsers?
  
  what do i need to add to make it work with netscape under linux?
  code follows:
  
  ?
  if ($_POST[submit]) {
  print submittedBR;
  for($i=0;$isizeof($foo);$i++) {
  print $foo[$i]BR;
  }
  }
  else {
  ?
  form action=? echo $_SERVER[PHP_SELF] ? method=post
input type=checkbox name=foo[] value=oneOne
input type=checkbox name=foo[] value=twoTwo
input type=checkbox name=foo[] value=threeThree
input type=submit value=submit name=submit
  /form
 
 Try putting quotes () around your types, names, and values in your
 input elements. Netscape may not recognize foo[] as a proper name
 without the quotes and send the data incorrectly.
 
 ---John Holmes...
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos  More
http://faith.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] newline in string

2002-10-13 Thread Jason Wong

On Sunday 13 October 2002 17:24, Shawn McKenzie wrote:
 I have loaded an html file into a string.  How can I search the string for
 newlines/linefeeds? I know they are there, because if I echo the string and
 view source in the browser, some tags are on new lines.

 Example:
 html

 head
 /head

Search for \r and \n for linefeeds and newlines respectively. Note you 
must use double-quotes.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
From the cradle to the coffin underwear comes first.
-- Bertolt Brecht
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: syntax error on mysql select statement

2002-10-13 Thread Coskun SUNALI

SELECT * FROM ad AS t1


Where is the table?
Should be like:

SELECT ad AS t1 FROM table_name Where .. Limit 0,n

Coskun SUNALI / Turkey

Pablo Oliva [EMAIL PROTECTED] wrote in message
000101c2726e$c506ee50$6a6c0444@cr8tivewerk">news:000101c2726e$c506ee50$6a6c0444@cr8tivewerk...
 Can anyone see any problems with the following:
 SELECT * FROM ad AS t1, ad_location AS t2 ORDER BY t1.ad_ts_update LIMIT
 0,40 WHERE t1.ad_location = t2.ad_loc_id AND ( (t1.ad_cdl_a = on OR
 t1.ad_cdl_b = on) AND t1.ad_longhaul = on AND t1.ad_fulltime = on ) AND
 ( t2.ca_losangeles = 1 OR t2.ca_santaana = 1 ) AND t1.ad_display = 1

 The error I get is:
 You have an error in your SQL syntax near 'WHERE t1.ad_location =
 t2.ad_loc_id AND ( t1.ad_cdl_a = on AND t1.ad_longhaul = ' at line 1




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Upload Problem

2002-10-13 Thread Sascha Cunz

Hi,
as far as i can follow you, you want to:
  1. copy a file from position a to position b.
  2. read it from position b.
  3. and delete it at position b.

Why not read it directly from position a?
So what about:
  $content = implode(br, file($userfile));

Anyway: You should initialize $i in any way, best with zero - $i=0; before 
the while loop.
You check if 0.tab 1.tab 2.tab; if 2.tab exists, you create 3tab (A dot seems 
to be missing) $destfile .= '.tab'; instead of $destfile .= tab;

Is this script executed on unix? That would clearify why it could not find 
C:\\My Documents\\lyrics\\C_DTBS\\SLIME.TXT :-)

--Sascha

Am Sonntag, 13. Oktober 2002 12:15 schrieb [EMAIL PROTECTED]:
 I posted User Upload and with no advice I attempted to use the sources i
 could find and came up with the following:

 while (file_exists($i.tab)) {
 $i ++;
 }
 $destfile = $i;
 $destfile .= tab;
 stripslashes($userfile);
 copy($userfile, /uploads/ . $destfile);
 chdir(/uploads);
 $lines = file($destfile);
 $content = implode(br, $lines);
 unlink($destfile);
 echo($userfile_name);

 It doesnt work (surprise, surprise), what im trying to do is upload the
 file to my /uploads/ directory then read it and store it on the $content
 variable, then the content variable inserts a row into db (allready done),
 then I delete the file the while loop is to make sure I dont overwrite the
 file and make an error in my database.

 The errors PHP returns are:

 Warning: Unable to open 'C:\\My Documents\\lyrics\\C_DTBS\\SLIME.TXT' for
 reading: No such file or directory in /home/tabzilla/public_html/doadd.php
 on line 89

 Warning: ChDir: No such file or directory (errno 2) in
 /home/tabzilla/public_html/doadd.php on line 90

 Warning: file(tab) - No such file or directory in
 /home/tabzilla/public_html/doadd.php on line 91

 Warning: Bad arguments to implode() in /home/tabzilla/public_html/doadd.php
 on line 92

 Warning: unlink() failed (No such file or directory) in
 /home/tabzilla/public_html/doadd.php on line 93


 ANY HELP? ANYONE???


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php cgi question

2002-10-13 Thread Marco Tabini

Without seeing your code... only one guess: what are the permissions on
the file like? When you're running the script from the web server,
you're running it as the user under which the web server is running
(usually nobody or apache if you're using Apache on Linux), and this
causes problem if that particular user doesn't have access to the file.

There are very few solutions to this problem (at least as far as I
know). One is the suexec module for Apache, that lets you impersonate
root or another user, but you have to be *extremely* careful with the
permissions. The other is to change the default permissions of the file
so that everyone can delete and modify it, but that might not work well
for your needs. Yet a third one would be to impersonate directly from
PHP, for example through a call to su, but there are pitfalls there as
well.

Hope this helps.

On Sun, 2002-10-13 at 02:37, David Cook wrote:
 Hi all,
 
 Got a question regarding using php scripts as cgi's.
 
 What I am trying to do is this. (ya may need a bit of background, it gets a
 little complicated... well for me its complicated)
 
 Im building a web based email system using php (duh) as the front end and
 glue for everything, part of it is using a program called getmail to
 retreive remote pop accounts to the virtual accounts on the server (its all
 virtual using qmail/vpopmail and courier-imap). The various setttings for
 this are in a file called getmailrc, in the virtual users home dir, (this
 will also be theoretically relevant when I try and do the same thing with a
 server side filtering program called maildrop.. but one at a time I reckon
 :))
 
 ie. /home/vpopmail/domains/some.email.domain/someuser/.getmail/getmailrc
 
 This file is owned specifically by a user/group otherwise getmail wont work
 
 ie: -rw-r--r--1 vpopmail vchkpw585 Sep 29 07:16 getmailrc
 
 any permissions other than this will tweak getmails internal security and
 stop it.
 
 I decided to minimise security problems and use mysql as an intermidiary
 storage for any rules created for getmail, which works fine. :) (yay me..
 lol)
 
 NOW comes the problem, I need to write (overwrite) that getmailrc file after
 the user has finished messing with their settings, to do this I decided that
 since the file can only be read/written to by the vpopmail/vchkpw
 user/group, that I would knock up a php script to run as a cgi, that would
 do only one thing: Upon a button being pressed to 'finish edit' the new
 rules would be written to the mysql table, then the cgi would be invoked
 with a particular identifier so that it could then look up the mysql table
 (using that identifier so it gets the right rows), and following some rules
 inbuilt, write out the getmailrc file with that restrictive permissions set.
 
 I wrote up a script that was just for POC, that would get the data for where
 that file was supposed to be (the /home/vpopmail/etc...etc) and read it,
 then break out the various details and display it, basically just showing me
 what was already in the file. (using the shebang method, as my php cgi
 interpreter is OUTSIDE the web tree, but thats another story of getting the
 damn thing to work at all... damn RPM'S sometimes...
 that --enable-force-redirect had me stuck for a few days)
 
 When I tested it out from the shell, using ./getmailtest.cgi as root, it
 worked, in that it did what it was sposed to.. display the contents of the
 getmailrc file. This cgi php script is owned by vpopmail/vchkpw which should
 allow reading the file as said above
 
 Great, thought I, and proceeded to attempt linking to it from within the
 editing script, using both an attempt with a 'submit' button and a click
 through link.
 
 Now comes the prob, it fails, with an error of being unable to either open
 the file, or that the file doesnt exist (depending on what I fiddle with in
 the script).
 
 Would anyone have any ideas as to what may be going wrong here? I havent
 tried doing this before, using php as a cgi to do stuff to files on the
 system, so I am at quite a loss, and any help would be appreciated.
 
 Regards
 
 David Cook
 
 
 
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: $html_code .= include (filetoinclude.txt);

2002-10-13 Thread John W. Holmes

No. That will not work. Include does not return the text to a variable.
Please read the manual page on include. You have to use file, fopen, or
include() _with_ output buffering in order for this to work.

---John Holmes...

 -Original Message-
 From: CJ [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, October 12, 2002 3:09 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: $html_code .= include (filetoinclude.txt);
 
 
 $html_code = $html_code.include(filetoinclude.txt);
 
 
 Research And Development wrote:
  Should this work?
 
  $html_code .= include (filetoinclude.txt);
 
  I am populating a variable with html to be printred later as usual:
  $html_code .= html.
 
  But I have some static html files that I want included in the html
that
  I am storing in the variable. The HTML is in text files. The above
code
  obviously does not work. I want to know if there is another way.
 
  Thanks.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $html_code .= include (filetoinclude.txt);

2002-10-13 Thread .: B i g D o g :.


Your email is not 100% totally clear with what you are actually trying
to accomplish, however, here is an example of how i like to get html
source code into a variable from a file.

$html_code = implode( '', file( 'filetoinclude.txt' ) );

or append it...

$html_code .= implode( '', file( 'filetoinclude.txt' ) );

Hope that helps you out.

On Sat, 2002-10-12 at 09:50, Research and Development wrote:
 Should this work?
 
 $html_code .= include (filetoinclude.txt);
 
 I am populating a variable with html to be printred later as usual: 
 $html_code .= html.
 
 But I have some static html files that I want included in the html that 
 I am storing in the variable. The HTML is in text files. The above code 
 obviously does not work. I want to know if there is another way.
 
 Thanks.

-- 
.: B i g D o g :.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP/mySQL help or advice

2002-10-13 Thread Marco Tabini

There are a few PHP calendars:

http://www.cascade.org.uk/software/php/calendar/index.php

for example, that you can start from. It should be relatively easy then
to write a small table that contains just one field:

Date (datetime)

All you do is insert a row in the db for each day that is booked and
then whenever you have to check just hit the database: if there is a row
corresponding to the day you're checking, then the day is booked,
otherwise it isn't.

This is kind of the short version, but hopefully it should give you
enough to get going!

Cheers,


Marco

On Sun, 2002-10-13 at 07:48, Ray Healy (Data Net Services) wrote:
 Hi All
 
 I have been trying to write a database and scripts for a calendar that shows which 
days are booked and have failed at each point.
 
 What i would like it to do is to show a calendar which have the dates that are 
booked in a cell which are colour coded (say red) when it is unavailable and say 
white when available.
 
 The admiministartor should be able to enter multiple dates at a time (say a holiday 
is booked for 5 days). perhaps a section for nortes that is only available for admin 
use only would be handy.
 
 An option to view 2 months at a time or perhaps the whole year would also be nice.
 
 I have downloaded various scripts and tried to write my own but I cannot seem to be 
able to enter multiple dates or colour code the output.
 
 Can anyone help me or perhaps someone already has a script  database that does this 
and would be willing to share.
 
 Otherwise it there a script already out there that will do this - all the one that I 
can find seem to do too much by allowing multiple users and storing a lot more data 
which is something I do nort need.
 
 Any help would be appreciated as I am tearing my hair out at the moment.
 
 Thanks for your time
 
 Ray Healy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Predefined variables not set?

2002-10-13 Thread Sascha Cunz

Am Sonntag, 13. Oktober 2002 10:04 schrieb Miles:
 When trying to get $_SERVER[QUERY_STRING] I am getting 'Undefined index
 QUERY_STRING' error

 If there is a query string, e.g.  www.site.com/index.php?hello_world then
 it IS defined.  So it seems that PHP is complaining about undefined
 variables, rather than just outputting nothing.

 How can I fix this?  I've had no problems until i reinstalled php today...

I think on your prior installation, error reporting level was set lower than 
on your new installation. The better way is to fix the script, that this 
condition doesn't occur at all -- 
if (isset($_SERVER['QUERY_STRING'])) { ... }

Sascha

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: getimagesize() with ftp-url?

2002-10-13 Thread nicos

getimagesize isn't remote.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

Stefan Wessman [EMAIL PROTECTED] a écrit dans le message de news:
[EMAIL PROTECTED]
 Hi!

 Can anyone tell me if the getimagesize() function is supposed to work with
 ftp-url's?
 The PHP Manual states URL support was added in PHP 4.0.5, but maby that
is
 supposed to mean http-url's only?

 The following is an expample of how i would like to be able to use
 getimagesize():

 ?php
 $size =
 getimagesize(ftp://user:[EMAIL PROTECTED]/pictures/image.jpg;);

 echo 'pre';
 print_r($size);
 echo '/pre';
 ?

 This code yields the following errors in my log:

 [12-Oct-2002 23:32:14] PHP Warning:  getimagesize(): php_hostconnect:
 connect failed in getimagesize.php on line 2
 [12-Oct-2002 23:32:14] PHP Warning:  getimagesize(...): failed to create
 stream: FTP server reports 227 Entering Passive Mode (194.236.xxx.xxx in
 getimagesize.php on line 2

 Is this a bug, or is it a missing feature, or maby a documentation issue?
 I've tried it on a few different ftp-servers, so i don't think that is the
 problem.. but who knows?

 Any thoghts would be appreciated.

 /OnionMan





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP/mySQL help or advice

2002-10-13 Thread Ray Healy \(Data Net Services\)

Hi All

I have been trying to write a database and scripts for a calendar that shows which 
days are booked and have failed at each point.

What i would like it to do is to show a calendar which have the dates that are booked 
in a cell which are colour coded (say red) when it is unavailable and say white when 
available.

The admiministartor should be able to enter multiple dates at a time (say a holiday is 
booked for 5 days). perhaps a section for nortes that is only available for admin use 
only would be handy.

An option to view 2 months at a time or perhaps the whole year would also be nice.

I have downloaded various scripts and tried to write my own but I cannot seem to be 
able to enter multiple dates or colour code the output.

Can anyone help me or perhaps someone already has a script  database that does this 
and would be willing to share.

Otherwise it there a script already out there that will do this - all the one that I 
can find seem to do too much by allowing multiple users and storing a lot more data 
which is something I do nort need.

Any help would be appreciated as I am tearing my hair out at the moment.

Thanks for your time

Ray Healy



RE: [PHP] how to configure with ldap?

2002-10-13 Thread Tony Earnshaw

fre, 2002-10-11 kl. 20:11 skrev Jody Cleveland:

 Well, I installed openldap, and it tests out good. Now, I want to configure
 php to work with it. My question now is, where exactly is ldap located? I
 tried a few paths:
 ./configure --with-mysql --with-apxs2=/www/bin/apxs
 --with-ldap=/usr/local/etc/openldap
 ./configure --with-mysql --with-apxs2=/www/bin/apxs
 --with-ldap=/usr/local/libexec

 And, I get this error:
 checking for LDAP support... yes
 configure: error: Cannot find ldap.h

 So, I searched for ldap.h and used that path:
 ./configure --with-mysql --with-apxs2=/www/bin/apxs --with-ldap=/usr/include
 Same thing, cannot find.

 Any ideas?

Using LDAP needs specialist knowledge - you can't just bung it in and
expect it to work. You can't really compare it to SQL in that respect,
it's a niche - like PHP :-)

ftp://kalamazoolinux.org/pub/pdf/ldapv3.pdf
http://www.redbooks.ibm.com/pubs/pdfs/redbooks/sg244986.pdf
http://www.redbooks.ibm.com/pubs/pdfs/redbooks/sg245110.pdf

Best,

Tony

-- 

Tony Earnshaw

There are many people who can't face the truth ... If you rob a
normal person of life's lies, at the same time you'll be robbing
him of his happiness.

From Henrik Ibsen's Vildanden, The wild Duck.

e-post: [EMAIL PROTECTED]
www:http://www.billy.demon.nl





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: $html_code .= include (filetoinclude.txt);

2002-10-13 Thread @ Edwin
Hello,

The function might be available in the next release so you don't have to
define your own.

  http://www.php.net/manual/en/function.file-get-contents.php

But until then...

- E

"Shawn McKenzie" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 function file_get_contents($filename) {
 $fp = @fopen($filename, "r");
  if (!($fp)) {
  return 0;
  }
  while (!feof($fp))  {
 $temp .= fread($fp, 4096);
  }
  return $temp;
 }

 and then:  $html_code = file_get_contents(filetoinclude.txt);

 HTH
 -Shawn

 "Research And Development" [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Should this work?
 
  $html_code .= include ("filetoinclude.txt");
 
  I am populating a variable with html to be printred later as usual:
  $html_code .= "html".
 
  But I have some static html files that I want included in the html that
  I am storing in the variable. The HTML is in text files. The above code
  obviously does not work. I want to know if there is another way.
 
  Thanks.
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: getimagesize() with ftp-url?

2002-10-13 Thread Stefan Wessman

Well, it is remote in the case of http-url's.

Try this code:

?php
 $size = getimagesize(http://www.php.net/gifs/php_logo.gif;);

 echo 'pre';
 print_r($size);
 echo '/pre';
?

And you will see this result:

Array
(
[0] = 120
[1] = 64
[2] = 1
[3] = width=120 height=64
[bits] = 8
[channels] = 3
[mime] = image/gif
)

My point is that it would be nice if the same could be done with an ftp-url.
I don't know if there are any issues that would make this hard to implement,
but if it is possible i think this should be added to complement the
http-url support.

/OnionMan
[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 getimagesize isn't remote.

 --

 Nicos - CHAILLAN Nicolas
 [EMAIL PROTECTED]
 www.WorldAKT.com - Hébergement de sites Internet

 Stefan Wessman [EMAIL PROTECTED] a écrit dans le message de news:
 [EMAIL PROTECTED]
  Hi!
 
  Can anyone tell me if the getimagesize() function is supposed to work
with
  ftp-url's?
  The PHP Manual states URL support was added in PHP 4.0.5, but maby
that
 is
  supposed to mean http-url's only?
 
  The following is an expample of how i would like to be able to use
  getimagesize():
 
  ?php
  $size =
  getimagesize(ftp://user:[EMAIL PROTECTED]/pictures/image.jpg;);
 
  echo 'pre';
  print_r($size);
  echo '/pre';
  ?
 
  This code yields the following errors in my log:
 
  [12-Oct-2002 23:32:14] PHP Warning:  getimagesize(): php_hostconnect:
  connect failed in getimagesize.php on line 2
  [12-Oct-2002 23:32:14] PHP Warning:  getimagesize(...): failed to create
  stream: FTP server reports 227 Entering Passive Mode (194.236.xxx.xxx in
  getimagesize.php on line 2
 
  Is this a bug, or is it a missing feature, or maby a documentation
issue?
  I've tried it on a few different ftp-servers, so i don't think that is t
he
  problem.. but who knows?
 
  Any thoghts would be appreciated.
 
  /OnionMan
 
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




php-general Digest 13 Oct 2002 11:51:45 -0000 Issue 1641

2002-10-13 Thread php-general-digest-help


php-general Digest 13 Oct 2002 11:51:45 - Issue 1641

Topics (messages 119752 through 119782):

php 4.3.0pre and openssl 0.96g compile error
119752 by: Jochen Kächelin

Re: POST and GET variables don't work
119753 by: Jennifer Swofford
119754 by: Oscar F
119755 by: Andres Olarte
119756 by: John W. Holmes
119757 by: Jennifer Swofford
119758 by: Sascha Cunz

Re: getimagesize() with ftp-url?
119759 by: Stefan Wessman

Multiple Return Values from function
119760 by: Paul Maine
119763 by: .: B i g D o g :.
119764 by: Marco Tabini

html form array
119761 by: tim tom
119765 by: John W. Holmes
119766 by: Roger Thomas

Re: what does _\\_ mean?
119762 by: Ns_Andy

syntax error on mysql select statement
119767 by: Pablo Oliva
119768 by: John W. Holmes
119769 by: Marco Tabini
119771 by: Coskun SUNALI

php cgi question
119770 by: David Cook

Predefined variables not set?
119772 by: Miles
119773 by: Chris Hewitt

Re: $html_code .= include (filetoinclude.txt);
119774 by: Shawn McKenzie
119780 by: . Edwin

newline in string
119775 by: Shawn McKenzie
119776 by: Jason Wong

A little help needed, I cant figure!
119777 by: Randum Ian

Upload Problem
119778 by: tony.tabzilla.com
119781 by: Chris Hewitt

Re: PHP in crontab job
119779 by: Juhan Kundla

PHP/mySQL help or advice
119782 by: Ray Healy \(Data Net Services\)

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---

I tried to compile PHP with OpenSSL (0.96g) support with

--with-openssl=/usr/src/web/openssl/current

the way I did it since 4.1.0.

I  always  get  the  message,  that  php  can't  find  the  openssl
include-files.

Any suggestions?

-- 
Jochen Kaechelin


---End Message---
---BeginMessage---

Try:

$_Post[name];

or $HTTP_POST_VARS[name];

In new PHP version, register_globals is set to off by default, which is
why $name isn't working for you.  Although, I'm surprised GET isn't
working

Jen


 I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with

 configure --with-java --with-apxs=/usr/local/apache/bin/apx

 It's running with Apache 1.3.26

 PHP work ok, even Java works, but if I try to pass variables from a form
 with either POST or GET, the variables don't get through.  This is the
code
 I'm using:

 index.html:
 ...
 form action=php.php method=post
  Name: input type=text name=namebr
   input type=submit
   /form
 ...

 php.php:

 ?php
 echo *;
 echo $name;
 echo *;
 ?

 The variable $name is always empty.  I tried this same scripts on the RPM
 version installed with Mandrake 7.2 and it worked fine, so it shouldn't be
 the scripts.  What could be wrong? Maybe I missed a ./configure option?

 Thanks in advance,


 Andres




---End Message---
---BeginMessage---

Most likely you have register_globals set to off on your php.ini. 
Change this to register_globals = on (or true, or yes, either one 
should).

If you dont want to do that, Try with $_GET['name'] or $_POST['name'].

HTH.

   Oscar F.-

Andres Olarte wrote:

 
 
 
 I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with
 
 configure --with-java --with-apxs=/usr/local/apache/bin/apx
 
 It's running with Apache 1.3.26
 
 PHP work ok, even Java works, but if I try to pass variables from a form 
 with either POST or GET, the variables don't get through.  This is the 
 code I'm using:
 
 index.html:
 ...
 form action=php.php method=post
 Name: input type=text name=namebr
  input type=submit
  /form
 ...
 
 php.php:
 
 ?php
 echo *;
 echo $name;
 echo *;
 ?
 
 The variable $name is always empty.  I tried this same scripts on the 
 RPM version installed with Mandrake 7.2 and it worked fine, so it 
 shouldn't be the scripts.  What could be wrong? Maybe I missed a 
 ./configure option?
 
 Thanks in advance,
 
 
 Andres
 
 
 
 _
 Únase al mayor servicio mundial de correo electrónico: 
 http://www.hotmail.com/es
 
 



---End Message---
---BeginMessage---

Thanks to Oscar and Jennifer, it's working now.  I did a bit of reading, and 
it seems it's not recommend to enable register_globlas, why is that?

Is there an array that contains both POST and GET variables or am I stuck to 
using two different ones?




From: Oscar F [EMAIL PROTECTED]
To: Andres Olarte [EMAIL PROTECTED],php-general 
[EMAIL PROTECTED]
Subject: Re: [PHP] POST and GET variables don't work
Date: Sat, 12 Oct 2002 19:58:04 -0400

Most likely you have register_globals set to off on your php.ini. Change 
this to register_globals = on (or true, or yes, 

RE: [PHP] syntax error on mysql select statement

2002-10-13 Thread John W. Holmes

ORDER BY and LIMIT go at the end...after WHERE.

---John Holmes...

 -Original Message-
 From: Pablo Oliva [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, October 13, 2002 12:13 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] syntax error on mysql select statement
 
 Can anyone see any problems with the following:
 SELECT * FROM ad AS t1, ad_location AS t2 ORDER BY t1.ad_ts_update
LIMIT
 0,40 WHERE t1.ad_location = t2.ad_loc_id AND ( (t1.ad_cdl_a = on OR
 t1.ad_cdl_b = on) AND t1.ad_longhaul = on AND t1.ad_fulltime = on )
AND
 ( t2.ca_losangeles = 1 OR t2.ca_santaana = 1 ) AND t1.ad_display = 1
 
 The error I get is:
 You have an error in your SQL syntax near 'WHERE t1.ad_location =
 t2.ad_loc_id AND ( t1.ad_cdl_a = on AND t1.ad_longhaul = ' at line 1
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] how to configure with ldap?

2002-10-13 Thread Ray Hunter

Tony's right on this one. 

1. Read all the instructions from the PHP documentation on setting up
LDAP. (From the last time i set this up you need to do some thing.)

2. After you have read that and then messed with it a while and you
still do not have all it working then you can post. (RTM).

3. Then you need to know how to run an LDAP server or you are going to
have a pain in the ass trying to connect and pulling data.  It took me
about 2 days to figure how to work with Exchange..

And do a search on how to configure PHP with extensions.  I have asked
this question more than once.  PHP's makefile search in specific
locations when configuring.


On Sat, 2002-10-12 at 14:50, Tony Earnshaw wrote:
 fre, 2002-10-11 kl. 20:11 skrev Jody Cleveland:
 
  Well, I installed openldap, and it tests out good. Now, I want to configure
  php to work with it. My question now is, where exactly is ldap located? I
  tried a few paths:
  ./configure --with-mysql --with-apxs2=/www/bin/apxs
  --with-ldap=/usr/local/etc/openldap
  ./configure --with-mysql --with-apxs2=/www/bin/apxs
  --with-ldap=/usr/local/libexec
 
  And, I get this error:
  checking for LDAP support... yes
  configure: error: Cannot find ldap.h
 
  So, I searched for ldap.h and used that path:
  ./configure --with-mysql --with-apxs2=/www/bin/apxs --with-ldap=/usr/include
  Same thing, cannot find.
 
  Any ideas?
 
 Using LDAP needs specialist knowledge - you can't just bung it in and
 expect it to work. You can't really compare it to SQL in that respect,
 it's a niche - like PHP :-)
 
 ftp://kalamazoolinux.org/pub/pdf/ldapv3.pdf
 http://www.redbooks.ibm.com/pubs/pdfs/redbooks/sg244986.pdf
 http://www.redbooks.ibm.com/pubs/pdfs/redbooks/sg245110.pdf
 
 Best,
 
 Tony
 
 -- 
 
 Tony Earnshaw
 
 There are many people who can't face the truth ... If you rob a
 normal person of life's lies, at the same time you'll be robbing
 him of his happiness.
 
 From Henrik Ibsen's Vildanden, The wild Duck.
 
 e-post:   [EMAIL PROTECTED]
 www:  http://www.billy.demon.nl
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Thank you,

Ray Hunter



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] getimagesize() with ftp-url?

2002-10-13 Thread Marek Kilimajer

I remember I got these kinds of errors when I wanted to connect to a 
slow server, the last message was always something like port command 
successfull, and that was it. Try connection to localhost, if that works?

Stefan Wessman wrote:

Hi!

Can anyone tell me if the getimagesize() function is supposed to work with
ftp-url's?
The PHP Manual states URL support was added in PHP 4.0.5, but maby that is
supposed to mean http-url's only?

The following is an expample of how i would like to be able to use
getimagesize():

?php
$size =
getimagesize(ftp://user:[EMAIL PROTECTED]/pictures/image.jpg;);

echo 'pre';
print_r($size);
echo '/pre';
?

This code yields the following errors in my log:

[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(): php_hostconnect:
connect failed in getimagesize.php on line 2
[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(...): failed to create
stream: FTP server reports 227 Entering Passive Mode (194.236.xxx.xxx in
getimagesize.php on line 2

Is this a bug, or is it a missing feature, or maby a documentation issue?
I've tried it on a few different ftp-servers, so i don't think that is the
problem.. but who knows?

Any thoghts would be appreciated.

/OnionMan



  



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




php-general Digest 12 Oct 2002 23:46:08 -0000 Issue 1640

2002-10-13 Thread php-general-digest-help


php-general Digest 12 Oct 2002 23:46:08 - Issue 1640

Topics (messages 119728 through 119751):

Re: An small SQL problem
119728 by: Davy Obdam
119731 by: Brad Bulger
119736 by: Davy Obdam

Re: Odd request
119729 by: Noodle Snacks

Re: fgetcsv or other
119730 by: . Edwin

Re: WinAMP Plugin Question
119732 by: Andrew Brampton

PHP caching ideas?
119733 by: Hans Himmel

User Upload
119734 by: tony.tabzilla.com
119741 by: Stephen

$html_code .= include (filetoinclude.txt);
119735 by: Research and Development
119737 by: CJ
119738 by: John W. Holmes
119739 by: .: B i g D o g :.

High-Res Images
119740 by: Oscar F
119744 by: Marek Kilimajer

Re: how to configure with ldap?
119742 by: Tony Earnshaw
119743 by: Ray Hunter

getimagesize() with ftp-url?
119745 by: Stefan Wessman
119746 by: nicos.php.net
119750 by: Marek Kilimajer

trying to get a certain num of rows in mysql
119747 by: Pablo Oliva
119748 by: Timothy J Hitchens
119749 by: Marek Kilimajer

POST and GET variables don't work
119751 by: Andres Olarte

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---

Hi Christian,

I am not 100% sure cos i am doing this from my head but your SELECT 
query would have to look like this:

SELECT TableA.FieldA2 FROM TableA, TableB WHERE TableA.FieldA1 != 
TableB.FieldB2

btw. Wouldn`t be easier to use more informative Table and Field names..?
Hope it works,

Best regards,

Davy Obdam
mailto:[EMAIL PROTECTED]

Christian Ista wrote:

Hello,

I'm probably sleepy because I can't do a very easy query. :(

I have 2 tables TableA(FieldA1, FieldA2, FieldA3) and TableB(FieldB1,
FieldB2, FieldB3).

I'd like to see the TableA records (FieldA2) where the FieldA1(Primary
key) not exist in TableB(FieldB2). I tried not exists without success.

Could you help me ?

Christian,


  




---End Message---
---BeginMessage---


what database are you using? because the answer is different, depending.

on postgres, for example, which supports subselects, you can do

select * from TableA where FieldA1 not in (select FieldB2 from TableB)

with mysql, there are no subselects, so you'd have to do something like

select TableA.*, TableB.FieldB1
from TableA left join TableB on TableA.FieldA1 = TableB.FieldB1
having FieldB1 is null

PS the one thing that for sure will not work is

select TableA.* from TableA, TableB where TableA.FieldA1 != TableB.FieldB2

that will just give you a cartesian product, returning a copy of
every row in TableA for every row in TableB that doesn't match its key

On Sat, 12 Oct 2002, Christian Ista wrote:

 Hello,

 I'm probably sleepy because I can't do a very easy query. :(

 I have 2 tables TableA(FieldA1, FieldA2, FieldA3) and TableB(FieldB1,
 FieldB2, FieldB3).

 I'd like to see the TableA records (FieldA2) where the FieldA1(Primary
 key) not exist in TableB(FieldB2). I tried not exists without success.

 Could you help me ?

 Christian,


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



---End Message---
---BeginMessage---

Hi Brad,

Oooops. I think i better go and  read your excelent book MySQL/PHP 
database applications agian..
Best regards,

Davy Obdam
mailto:[EMAIL PROTECTED]

Brad Bulger wrote:

what database are you using? because the answer is different, depending.

on postgres, for example, which supports subselects, you can do

select * from TableA where FieldA1 not in (select FieldB2 from TableB)

with mysql, there are no subselects, so you'd have to do something like

select TableA.*, TableB.FieldB1
from TableA left join TableB on TableA.FieldA1 = TableB.FieldB1
having FieldB1 is null

PS the one thing that for sure will not work is

select TableA.* from TableA, TableB where TableA.FieldA1 != TableB.FieldB2

that will just give you a cartesian product, returning a copy of
every row in TableA for every row in TableB that doesn't match its key

On Sat, 12 Oct 2002, Christian Ista wrote:

  

Hello,

I'm probably sleepy because I can't do a very easy query. :(

I have 2 tables TableA(FieldA1, FieldA2, FieldA3) and TableB(FieldB1,
FieldB2, FieldB3).

I'd like to see the TableA records (FieldA2) where the FieldA1(Primary
key) not exist in TableB(FieldB2). I tried not exists without success.

Could you help me ?

Christian,


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





  




---End Message---
---BeginMessage---


Shawn McKenzie [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Probably a question for the php dev team, but 

[PHP] newline in string

2002-10-13 Thread Shawn McKenzie

I have loaded an html file into a string.  How can I search the string for
newlines/linefeeds? I know they are there, because if I echo the string and
view source in the browser, some tags are on new lines.

Example:
html

head
/head

TIA
-Shawn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php cgi question

2002-10-13 Thread David Cook

Hi Marco

Thanks for the tips, they were what I was thinking was the problem, that
even when the php cgi was owned by the correct user, that if it was being
called via another web based script, that it would be executed as apache (in
this case) rather than the actual owner of the cgiscript (vpopmail/vchkpw),
the same ower/group as the target file. I had thought that if I used
setuid/gid on the cgi script that it would execute as that user, rather than
apache tho.

I didnt want to waste even more bandwidth by posting the code and all the
other details, I had hoped I had provided enough for some educated guesses
which may have led me to a solution, or what details to provide to help in a
solution

As I said, this was the first time I had attempted this precise situation
(that of executing a script as another user other than the web server), I
cant change the permissions on the getmailrc file, or the getmail program
wont read it, a bit of a catch 22 :( it seems.

 Without seeing your code... only one guess: what are the permissions on
 the file like?

The actual php cgi??? its
[root@alpha cgi-bin]# ls -lA get*
-rwxrwxr-x1 root root 6107 Oct 13 00:44 getmailtest.cgi

but I have messed with it, trying different combos including vpopmail:vchkpw
(the target file owner) all set as world executable

the permissions on the getmailrc file (the target file) are in my original
post but to show it again, it is
-rw-r--r--1 vpopmail vchkpw585 Sep 29 07:16 getmailrc

 When you're running the script from the web server,
 you're running it as the user under which the web server is running
 (usually nobody or apache if you're using Apache on Linux), and this
 causes problem if that particular user doesn't have access to the file.
which is why I thought (stressing thought.. like I said.. Ive never tried
this approach before) that the setuid/gid may have been the solution,
although testing did appear to indicate that it was executed as the web
server user when it is accessed via a click or button from the web, ignoring
the setuid etc...Like I was saying I may be trying somethign that is really
tough, but basically I wanted to partition out the part of the process that
may have security implications, and just pass a single variable to it,
executing it on demand, rather than via cron (though it does work via cron..
its not the best solution in my case.. but may be one I have to look at)

 There are very few solutions to this problem (at least as far as I
 know). One is the suexec module for Apache, that lets you impersonate
 root or another user, but you have to be *extremely* careful with the
 permissions. The other is to change the default permissions of the file
 so that everyone can delete and modify it, but that might not work well
 for your needs. Yet a third one would be to impersonate directly from
 PHP, for example through a call to su, but there are pitfalls there as
 well.

Even though I would reallyyy prefer NOT to go anywhere near su (cause
security is my primary focus in splitting out any file system writes to a
separate process) how would using su help out??? I havent done that either
so far (have never run into a situation like this before)

Thanks again for the reply... I will keep working on it.. and post back if I
get any further

Regards

David Cook



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] $html_code .= include (filetoinclude.txt);

2002-10-13 Thread Research and Development

Should this work?

$html_code .= include (filetoinclude.txt);

I am populating a variable with html to be printred later as usual: 
$html_code .= html.

But I have some static html files that I want included in the html that 
I am storing in the variable. The HTML is in text files. The above code 
obviously does not work. I want to know if there is another way.

Thanks.



[PHP] syntax error on mysql select statement

2002-10-13 Thread Pablo Oliva

Can anyone see any problems with the following:
SELECT * FROM ad AS t1, ad_location AS t2 ORDER BY t1.ad_ts_update LIMIT
0,40 WHERE t1.ad_location = t2.ad_loc_id AND ( (t1.ad_cdl_a = on OR
t1.ad_cdl_b = on) AND t1.ad_longhaul = on AND t1.ad_fulltime = on ) AND
( t2.ca_losangeles = 1 OR t2.ca_santaana = 1 ) AND t1.ad_display = 1

The error I get is:
You have an error in your SQL syntax near 'WHERE t1.ad_location =
t2.ad_loc_id AND ( t1.ad_cdl_a = on AND t1.ad_longhaul = ' at line 1 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Multiple Return Values from function

2002-10-13 Thread Paul Maine

Can I return more than one value from a function?

php

Thank You
Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] html form array

2002-10-13 Thread tim tom

dear all,
i ran my code below on ie and it works. but when i use netscape 4.76 under linux, i 
only get the
message submitted even though i've checked some fields.

what do i need to add to make it work with netscape under linux?
code follows:

?
if ($_POST[submit]) {
print submittedBR;
for($i=0;$isizeof($foo);$i++) {
print $foo[$i]BR;
}
}
else {
?
form action=? echo $_SERVER[PHP_SELF] ? method=post
  input type=checkbox name=foo[] value=oneOne
  input type=checkbox name=foo[] value=twoTwo
  input type=checkbox name=foo[] value=threeThree
  input type=submit value=submit name=submit
/form
?
}
?

--
best regards
tim

__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos  More
http://faith.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: what does _\\_ mean?

2002-10-13 Thread Ns_Andy

 Here's the code:
 $fp = fopen (a.txt)
 while ($buf = fgets($fp,1024) {
 trim($buf)
 if (substr($buf,-1 == _\\_) {

i missed a )
if (substr($buf,-1) == _\\_) {



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple Return Values from function

2002-10-13 Thread .: B i g D o g :.

I would probably return an array with the multiple values in the
array...easier to work with.


On Sat, 2002-10-12 at 20:49, Paul Maine wrote:
 Can I return more than one value from a function?
 
 php
 
 Thank You
 Paul
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.: B i g D o g :.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Multiple Return Values from function

2002-10-13 Thread Marco Tabini

Well, you could return an array that contains more than one value, or
you could pass some parameters by reference rather than by value
(although that's not always a good idea).

On Sat, 2002-10-12 at 22:49, Paul Maine wrote:
 Can I return more than one value from a function?
 
 php
 
 Thank You
 Paul
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] php cgi question

2002-10-13 Thread David Cook

Hi all,

Got a question regarding using php scripts as cgi's.

What I am trying to do is this. (ya may need a bit of background, it gets a
little complicated... well for me its complicated)

Im building a web based email system using php (duh) as the front end and
glue for everything, part of it is using a program called getmail to
retreive remote pop accounts to the virtual accounts on the server (its all
virtual using qmail/vpopmail and courier-imap). The various setttings for
this are in a file called getmailrc, in the virtual users home dir, (this
will also be theoretically relevant when I try and do the same thing with a
server side filtering program called maildrop.. but one at a time I reckon
:))

ie. /home/vpopmail/domains/some.email.domain/someuser/.getmail/getmailrc

This file is owned specifically by a user/group otherwise getmail wont work

ie: -rw-r--r--1 vpopmail vchkpw585 Sep 29 07:16 getmailrc

any permissions other than this will tweak getmails internal security and
stop it.

I decided to minimise security problems and use mysql as an intermidiary
storage for any rules created for getmail, which works fine. :) (yay me..
lol)

NOW comes the problem, I need to write (overwrite) that getmailrc file after
the user has finished messing with their settings, to do this I decided that
since the file can only be read/written to by the vpopmail/vchkpw
user/group, that I would knock up a php script to run as a cgi, that would
do only one thing: Upon a button being pressed to 'finish edit' the new
rules would be written to the mysql table, then the cgi would be invoked
with a particular identifier so that it could then look up the mysql table
(using that identifier so it gets the right rows), and following some rules
inbuilt, write out the getmailrc file with that restrictive permissions set.

I wrote up a script that was just for POC, that would get the data for where
that file was supposed to be (the /home/vpopmail/etc...etc) and read it,
then break out the various details and display it, basically just showing me
what was already in the file. (using the shebang method, as my php cgi
interpreter is OUTSIDE the web tree, but thats another story of getting the
damn thing to work at all... damn RPM'S sometimes...
that --enable-force-redirect had me stuck for a few days)

When I tested it out from the shell, using ./getmailtest.cgi as root, it
worked, in that it did what it was sposed to.. display the contents of the
getmailrc file. This cgi php script is owned by vpopmail/vchkpw which should
allow reading the file as said above

Great, thought I, and proceeded to attempt linking to it from within the
editing script, using both an attempt with a 'submit' button and a click
through link.

Now comes the prob, it fails, with an error of being unable to either open
the file, or that the file doesnt exist (depending on what I fiddle with in
the script).

Would anyone have any ideas as to what may be going wrong here? I havent
tried doing this before, using php as a cgi to do stuff to files on the
system, so I am at quite a loss, and any help would be appreciated.

Regards

David Cook








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] syntax error on mysql select statement

2002-10-13 Thread Marco Tabini

Yes, the LIMIT clause must be at the end of the line. Take a look at the
documentation:

http://www.mysql.com/doc/en/SELECT.html


On Sun, 2002-10-13 at 00:12, Pablo Oliva wrote:
 Can anyone see any problems with the following:
 SELECT * FROM ad AS t1, ad_location AS t2 ORDER BY t1.ad_ts_update LIMIT
 0,40 WHERE t1.ad_location = t2.ad_loc_id AND ( (t1.ad_cdl_a = on OR
 t1.ad_cdl_b = on) AND t1.ad_longhaul = on AND t1.ad_fulltime = on ) AND
 ( t2.ca_losangeles = 1 OR t2.ca_santaana = 1 ) AND t1.ad_display = 1
 
 The error I get is:
 You have an error in your SQL syntax near 'WHERE t1.ad_location =
 t2.ad_loc_id AND ( t1.ad_cdl_a = on AND t1.ad_longhaul = ' at line 1 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] html form array

2002-10-13 Thread John W. Holmes

 dear all,
 i ran my code below on ie and it works. but when i use netscape 4.76
under
 linux, i only get the
 message submitted even though i've checked some fields.

The code is running on the same box, right? Just accessing it with
different browsers?
 
 what do i need to add to make it work with netscape under linux?
 code follows:
 
 ?
 if ($_POST[submit]) {
 print submittedBR;
 for($i=0;$isizeof($foo);$i++) {
 print $foo[$i]BR;
 }
 }
 else {
 ?
 form action=? echo $_SERVER[PHP_SELF] ? method=post
   input type=checkbox name=foo[] value=oneOne
   input type=checkbox name=foo[] value=twoTwo
   input type=checkbox name=foo[] value=threeThree
   input type=submit value=submit name=submit
 /form

Try putting quotes () around your types, names, and values in your
input elements. Netscape may not recognize foo[] as a proper name
without the quotes and send the data incorrectly.

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] POST and GET variables don't work

2002-10-13 Thread Andres Olarte




I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with

configure --with-java --with-apxs=/usr/local/apache/bin/apx

It's running with Apache 1.3.26

PHP work ok, even Java works, but if I try to pass variables from a form 
with either POST or GET, the variables don't get through.  This is the code 
I'm using:

index.html:
...
form action=php.php method=post
 Name: input type=text name=namebr
  input type=submit
  /form
...

php.php:

?php
echo *;
echo $name;
echo *;
?

The variable $name is always empty.  I tried this same scripts on the RPM 
version installed with Mandrake 7.2 and it worked fine, so it shouldn't be 
the scripts.  What could be wrong? Maybe I missed a ./configure option?

Thanks in advance,


Andres



_
Únase al mayor servicio mundial de correo electrónico: 
http://www.hotmail.com/es


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] POST and GET variables don't work

2002-10-13 Thread Jennifer Swofford

Try:

$_Post[name];

or $HTTP_POST_VARS[name];

In new PHP version, register_globals is set to off by default, which is
why $name isn't working for you.  Although, I'm surprised GET isn't
working

Jen


 I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with

 configure --with-java --with-apxs=/usr/local/apache/bin/apx

 It's running with Apache 1.3.26

 PHP work ok, even Java works, but if I try to pass variables from a form
 with either POST or GET, the variables don't get through.  This is the
code
 I'm using:

 index.html:
 ...
 form action=php.php method=post
  Name: input type=text name=namebr
   input type=submit
   /form
 ...

 php.php:

 ?php
 echo *;
 echo $name;
 echo *;
 ?

 The variable $name is always empty.  I tried this same scripts on the RPM
 version installed with Mandrake 7.2 and it worked fine, so it shouldn't be
 the scripts.  What could be wrong? Maybe I missed a ./configure option?

 Thanks in advance,


 Andres




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] POST and GET variables don't work

2002-10-13 Thread Sascha Cunz

Am Sonntag, 13. Oktober 2002 02:11 schrieb Andres Olarte:
 Thanks to Oscar and Jennifer, it's working now.  I did a bit of reading,
 and it seems it's not recommend to enable register_globlas, why is that?

For security...

Imagine, you register a session variable to contain the user's ID. Anyone 
could login using that ID in a GET or POST variable with register_globals to 
on.

-Sascha

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] POST and GET variables don't work

2002-10-13 Thread Andres Olarte

Thanks to Oscar and Jennifer, it's working now.  I did a bit of reading, and 
it seems it's not recommend to enable register_globlas, why is that?

Is there an array that contains both POST and GET variables or am I stuck to 
using two different ones?




From: Oscar F [EMAIL PROTECTED]
To: Andres Olarte [EMAIL PROTECTED],php-general 
[EMAIL PROTECTED]
Subject: Re: [PHP] POST and GET variables don't work
Date: Sat, 12 Oct 2002 19:58:04 -0400

Most likely you have register_globals set to off on your php.ini. Change 
this to register_globals = on (or true, or yes, either one should).

If you dont want to do that, Try with $_GET['name'] or $_POST['name'].

HTH.

   Oscar F.-

Andres Olarte wrote:




I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with

configure --with-java --with-apxs=/usr/local/apache/bin/apx

It's running with Apache 1.3.26

PHP work ok, even Java works, but if I try to pass variables from a form 
with either POST or GET, the variables don't get through.  This is the 
code I'm using:

index.html:
...
form action=php.php method=post
 Name: input type=text name=namebr
  input type=submit
  /form
...

php.php:

?php
echo *;
echo $name;
echo *;
?

The variable $name is always empty.  I tried this same scripts on the RPM 
version installed with Mandrake 7.2 and it worked fine, so it shouldn't be 
the scripts.  What could be wrong? Maybe I missed a ./configure option?

Thanks in advance,


Andres



_
Únase al mayor servicio mundial de correo electrónico: 
http://www.hotmail.com/es






_
MSN Fotos: la forma más fácil de compartir e imprimir fotos. 
http://photos.msn.es/support/worldwide.aspx


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] POST and GET variables don't work

2002-10-13 Thread John W. Holmes

$_REQUEST[] (also contains cookies)

---John Holmes...

 -Original Message-
 From: Andres Olarte [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, October 12, 2002 8:11 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] POST and GET variables don't work
 
 Thanks to Oscar and Jennifer, it's working now.  I did a bit of
reading,
 and
 it seems it's not recommend to enable register_globlas, why is that?
 
 Is there an array that contains both POST and GET variables or am I
stuck
 to
 using two different ones?
 
 
 
 
 From: Oscar F [EMAIL PROTECTED]
 To: Andres Olarte [EMAIL PROTECTED],php-general
 [EMAIL PROTECTED]
 Subject: Re: [PHP] POST and GET variables don't work
 Date: Sat, 12 Oct 2002 19:58:04 -0400
 
 Most likely you have register_globals set to off on your php.ini.
 Change
 this to register_globals = on (or true, or yes, either one
should).
 
 If you dont want to do that, Try with $_GET['name'] or
$_POST['name'].
 
 HTH.
 
Oscar F.-
 
 Andres Olarte wrote:
 
 
 
 
 I've just built PHP from source (4.2.3) on Red Hat Linux 7.2 with
 
 configure --with-java --with-apxs=/usr/local/apache/bin/apx
 
 It's running with Apache 1.3.26
 
 PHP work ok, even Java works, but if I try to pass variables from a
form
 with either POST or GET, the variables don't get through.  This is
the
 code I'm using:
 
 index.html:
 ...
 form action=php.php method=post
  Name: input type=text name=namebr
   input type=submit
   /form
 ...
 
 php.php:
 
 ?php
 echo *;
 echo $name;
 echo *;
 ?
 
 The variable $name is always empty.  I tried this same scripts on
the
 RPM
 version installed with Mandrake 7.2 and it worked fine, so it
shouldn't
 be
 the scripts.  What could be wrong? Maybe I missed a ./configure
option?
 
 Thanks in advance,
 
 
 Andres
 
 
 
 _
 Únase al mayor servicio mundial de correo electrónico:
 http://www.hotmail.com/es
 
 
 
 
 
 
 _
 MSN Fotos: la forma más fácil de compartir e imprimir fotos.
 http://photos.msn.es/support/worldwide.aspx
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] php 4.3.0pre and openssl 0.96g compile error

2002-10-13 Thread Jochen Kchelin

I tried to compile PHP with OpenSSL (0.96g) support with

--with-openssl=/usr/src/web/openssl/current

the way I did it since 4.1.0.

I  always  get  the  message,  that  php  can't  find  the  openssl
include-files.

Any suggestions?

-- 
Jochen Kaechelin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] about mssql.....

2002-10-13 Thread php

If I want to use sql to access MS Access's database, is it necessary to have
mssql server?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] High-Res Images

2002-10-13 Thread Marek Kilimajer

You might have memory limit problem, try setting it higher. And as far 
as I know, there is no function in gd to tell you DPI, try imlib extension.

Oscar F wrote:

 Hello,

 I have a script that process images sent by users, but I'm having some 
 problems here.

 1) Does anybody know if there is any problem with hi-res images (300 
 DPI), because when I try to use them with PHP to resize/copy them, all 
 I get is a black box.

 2) Is there any way, with GD/PHP to get the DPI value of an image, 
 because the image they submit has to be 300 dpi.

 In short, I need the user to upload the file, and the script to verify 
 it is 300 DPI and to resize it to its equivalent size with 72 DPI.

 ANY help would be really appreciated.

Oscar F.-




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] about mssql.....

2002-10-13 Thread John W. Holmes

 If I want to use sql to access MS Access's database, is it necessary
to
 have
 mssql server?

No, just open up Access and go to town...

Now, if you mean you want to get to Access from PHP, then you still
don't need MSSQL. You can connect to Access using ODBC or COM.

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] newline in string

2002-10-13 Thread Shawn McKenzie

Thanks everyone.  I'' be breaking the string after the newline so that I can
convert the html to php echos and write them to a file.

-Shawn

John W. Holmes [EMAIL PROTECTED] wrote in message
000d01c272c1$54d0$7c02a8c0@coconut">news:000d01c272c1$54d0$7c02a8c0@coconut...
  I have loaded an html file into a string.  How can I search the string
 for
  newlines/linefeeds? I know they are there, because if I echo the
 string
  and
  view source in the browser, some tags are on new lines.
 
  Example:
  html
 
  head
  /head

 And do what when you find them? If you just want to know if there are
 newlines in the file, then use strstr(). If you want to remove or
 replace them, then use str_replace(). If you want to add in a br where
 some newlines are, then use nl2br().

 ---John Holmes...





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] High-Res Images

2002-10-13 Thread Oscar F

Hello,

I have a script that process images sent by users, but I'm having some 
problems here.

1) Does anybody know if there is any problem with hi-res images (300 
DPI), because when I try to use them with PHP to resize/copy them, all I 
get is a black box.

2) Is there any way, with GD/PHP to get the DPI value of an image, 
because the image they submit has to be 300 dpi.

In short, I need the user to upload the file, and the script to verify 
it is 300 DPI and to resize it to its equivalent size with 72 DPI.

ANY help would be really appreciated.
 
Oscar F.-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php cgi question

2002-10-13 Thread Marco Tabini

Hi David--

If that is the issue then I would suggest looking into the suexec module
for Apache...as long as you're very careful with the permissions, you
should be fine!

Also, my reference to the code was more a caveat than anything else.
In your case, if the script was working from the sell, imho you made a
good decision not to post the source, since the problem was clearly
somewhere else.

Marco

On Sun, 2002-10-13 at 11:20, David Cook wrote:
 Hi Marco
 
 Thanks for the tips, they were what I was thinking was the problem, that
 even when the php cgi was owned by the correct user, that if it was being
 called via another web based script, that it would be executed as apache (in
 this case) rather than the actual owner of the cgiscript (vpopmail/vchkpw),
 the same ower/group as the target file. I had thought that if I used
 setuid/gid on the cgi script that it would execute as that user, rather than
 apache tho.
 
 I didnt want to waste even more bandwidth by posting the code and all the
 other details, I had hoped I had provided enough for some educated guesses
 which may have led me to a solution, or what details to provide to help in a
 solution
 
 As I said, this was the first time I had attempted this precise situation
 (that of executing a script as another user other than the web server), I
 cant change the permissions on the getmailrc file, or the getmail program
 wont read it, a bit of a catch 22 :( it seems.
 
  Without seeing your code... only one guess: what are the permissions on
  the file like?
 
 The actual php cgi??? its
 [root@alpha cgi-bin]# ls -lA get*
 -rwxrwxr-x1 root root 6107 Oct 13 00:44 getmailtest.cgi
 
 but I have messed with it, trying different combos including vpopmail:vchkpw
 (the target file owner) all set as world executable
 
 the permissions on the getmailrc file (the target file) are in my original
 post but to show it again, it is
 -rw-r--r--1 vpopmail vchkpw585 Sep 29 07:16 getmailrc
 
  When you're running the script from the web server,
  you're running it as the user under which the web server is running
  (usually nobody or apache if you're using Apache on Linux), and this
  causes problem if that particular user doesn't have access to the file.
 which is why I thought (stressing thought.. like I said.. Ive never tried
 this approach before) that the setuid/gid may have been the solution,
 although testing did appear to indicate that it was executed as the web
 server user when it is accessed via a click or button from the web, ignoring
 the setuid etc...Like I was saying I may be trying somethign that is really
 tough, but basically I wanted to partition out the part of the process that
 may have security implications, and just pass a single variable to it,
 executing it on demand, rather than via cron (though it does work via cron..
 its not the best solution in my case.. but may be one I have to look at)
 
  There are very few solutions to this problem (at least as far as I
  know). One is the suexec module for Apache, that lets you impersonate
  root or another user, but you have to be *extremely* careful with the
  permissions. The other is to change the default permissions of the file
  so that everyone can delete and modify it, but that might not work well
  for your needs. Yet a third one would be to impersonate directly from
  PHP, for example through a call to su, but there are pitfalls there as
  well.
 
 Even though I would reallyyy prefer NOT to go anywhere near su (cause
 security is my primary focus in splitting out any file system writes to a
 separate process) how would using su help out??? I havent done that either
 so far (have never run into a situation like this before)
 
 Thanks again for the reply... I will keep working on it.. and post back if I
 get any further
 
 Regards
 
 David Cook
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Boolean Search Interpreter

2002-10-13 Thread John W. Holmes

It may be better to just let your database handle it. I know MySQL
supports Boolean fulltext searches (in 4.0, I think), and I'm sure
others do too. 

---John Holmes...

 -Original Message-
 From: SpamSucks86 [mailto:[EMAIL PROTECTED]]
 Sent: Friday, October 11, 2002 7:13 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Boolean Search Interpreter
 
 Is there an algorithm in PHP or pseudo-code, or any other language
that
 could help me write an algorithm to take a Boolean search string and
 parse it and convert it into SQL? I can convert it to SQL just fine, I
 just need help parsing the string and figuring out what they want
(AND,
 NOT, OR). Thanks for any and all help!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Best Forum System

2002-10-13 Thread Brian V Bonini

Phorum seems to be real popular, see http://phorum.org

 -Original Message-
 From: Stephen [mailto:[EMAIL PROTECTED]]
 Sent: Friday, October 11, 2002 5:37 PM
 To: PHP List
 Subject: [PHP] Best Forum System
 
 
 Hello,
 
 I know there will be a load of different responses but I'm after 
 the most frequent one. What exactly is the best forum system out 
 there? I'm mainly after a PHP one but a Perl or CGI one will do 
 just fine. Thanks!
 
 Thanks,
 Stephen Craton
 http://www.melchior.us
 http://php.melchior.us

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Best Forum System

2002-10-13 Thread Marco Tabini

I use phpbb for our internal forums as well as a public forum on a
website (http://www.nonsologiochi.com/forums -- it's in Italian) and it
works pretty well.


On Fri, 2002-10-11 at 17:36, Stephen wrote:
 Hello,
 
 I know there will be a load of different responses but I'm after the most frequent 
one. What exactly is the best forum system out there? I'm mainly after a PHP one but 
a Perl or CGI one will do just fine. Thanks!
 
 Thanks,
 Stephen Craton
 http://www.melchior.us
 http://php.melchior.us



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] People who searched this also searched this!

2002-10-13 Thread Randum Ian

Hi guys,

Does anybody have a working example of doing the lists of 'People who
searched this also searched this!' that I see on Amazon and other
websites.

Any help much appreciated!

Randum Ian
[EMAIL PROTECTED]
DJ / Reviewer / Webmaster, DancePortal (UK) Limited 
DancePortal.co.uk - Global dance music media




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] How to access MS ACCESS's database files

2002-10-13 Thread php

By Using mssql_command???



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] A little help needed, I cant figure!

2002-10-13 Thread Chris Hewitt

John W. Holmes wrote:

Song Table:
Song_id
A_id
Type
Name
Length
Lyrics
...

That's my ideas on how to do it. There are many ways to do it, though.

Totally agree with what John says. If the lyrics are long (as I assume 
they will be) then I'd probably hive the lyrics off into a table of 
their own with as many records as needed to make up one song. The song 
table would then become:

Song Table:
Song_id
A_id
Type
Name
Length
Lyric_id

and have a lyrics table such as:

Lyrics Table:
Lyric_id
sequence
text

The sequence would be an incrementing number (starting at 1 for each new 
lyric_id), so you could have many records per song. Index this table on 
lyric_id, sequence.

Make sure in your code that you maintain integrity between tables. That 
is, if you delete a record from the artists table, ensure you delete 
relevant records from the others too.

Just my 2p (I'm in the UK, so not even EuroZone, yet).

HTH
Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php 4.3.0pre and openssl 0.96g compile error

2002-10-13 Thread Tony Earnshaw

søn, 2002-10-13 kl. 01:48 skrev Jochen Kächelin:

 I tried to compile PHP with OpenSSL (0.96g) support with
 --with-openssl=/usr/src/web/openssl/current
 the way I did it since 4.1.0.

 I  always  get  the  message,  that  php  can't  find  the  openssl
 include-files.
 
 Any suggestions?

See if you have /usr/include/openssl . Which you most probably don't
have. If not, do: 'ln -s /usr/local/ssl/include/openssl
/usr/include/openssl' .

Best,

Tony

-- 

Tony Earnshaw

There are many people who can't face the truth ... If you rob a
normal person of life's lies, at the same time you'll be robbing
him of his happiness.

From Henrik Ibsen's Vildanden, The wild Duck.

e-post: [EMAIL PROTECTED]
www:http://www.billy.demon.nl





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Fatal error: Maximum execution time of 30 seconds exceeded

2002-10-13 Thread scott

Hello
Trying to send a html email to 5000 people on a list
Keep getting Fatal error: Maximum execution time of 30 seconds exceeded 
Any pointers on the best way to achieve this lengthily operation without
the script failing? Best regards Scott


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Fatal error: Maximum execution time of 30 seconds exceeded

2002-10-13 Thread John W. Holmes

www.php.net/set_time_limit

---John Holmes...

 -Original Message-
 From: scott [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, October 13, 2002 2:06 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Fatal error: Maximum execution time of 30 seconds
exceeded
 
 Hello
 Trying to send a html email to 5000 people on a list
 Keep getting Fatal error: Maximum execution time of 30 seconds
exceeded
 Any pointers on the best way to achieve this lengthily operation
without
 the script failing? Best regards Scott
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Predefined variables not set?

2002-10-13 Thread Oscar F

I'm pretty sure it's not $_SERVER[QUERY_STRING], it's 
$_SERVER['QUERY_STRING'] (note the ' instead of ).

HTH.

  Oscar F.-


Miles wrote:

 When trying to get $_SERVER[QUERY_STRING] I am getting 'Undefined index 
QUERY_STRING' error
 
 If there is a query string, e.g.  www.site.com/index.php?hello_world then it IS 
defined.  So it seems that PHP is complaining about undefined variables, rather than 
just outputting nothing.
 
 How can I fix this?  I've had no problems until i reinstalled php today...
 
 Cheers,
 
 Miles
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Predefined variables not set?

2002-10-13 Thread Mark Charette

In this context it makes no difference whether or not  or ' is used (
allows variable substitution within the quoted string, ' does not) since
there's no substitution taking place.

Insert a phpinfo() in the top of your code to see all the variables that
_are_ being set.

-Original Message-
From: Oscar F [mailto:[EMAIL PROTECTED]]

I'm pretty sure it's not $_SERVER[QUERY_STRING], it's
$_SERVER['QUERY_STRING'] (note the ' instead of ).

HTH.

  Oscar F.-

Miles wrote:

 When trying to get $_SERVER[QUERY_STRING] I am getting 'Undefined index
QUERY_STRING' error

 If there is a query string, e.g.  www.site.com/index.php?hello_world then
it IS defined.  So it seems that PHP is complaining about undefined
variables, rather than just outputting nothing.

 How can I fix this?  I've had no problems until i reinstalled php today...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Fatal error: Maximum execution time of 30 seconds exceeded

2002-10-13 Thread Thoenen, Peter Mr. EPS

In you php.ini, find max_execution_time = 360 and up it.

-Peter

 -Original Message-
 From: scott [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, October 13, 2002 20:06
 To: [EMAIL PROTECTED]
 Subject: [PHP] Fatal error: Maximum execution time of 30 seconds
 exceeded 
 
 
 Hello
 Trying to send a html email to 5000 people on a list
 Keep getting Fatal error: Maximum execution time of 30 
 seconds exceeded 
 Any pointers on the best way to achieve this lengthily 
 operation without
 the script failing? Best regards Scott
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Fatal error: Maximum execution time of 30 seconds exceeded

2002-10-13 Thread Chris Hewitt

scott wrote:

Hello
Trying to send a html email to 5000 people on a list
Keep getting Fatal error: Maximum execution time of 30 seconds exceeded 
Any pointers on the best way to achieve this lengthily operation without
the script failing? Best regards Scott

If the email is the same for all people on the list (i.e. not 
customised) then use the CC field and don't send 5000 emails. If they 
are customised then I'd recommend you queue them (fast) rather than wait 
whilst they are actually sent (normal). This can be done with sendmail 
and qmail, I assume other MTAs too. If you can't queue the emails then 
perhaps use cron (or at) to send them outside of a web page (you can 
still use PHP as CLI or with Lynx).

If you look through the archives this was discussed a month or so back 
in great detail. One thread was PHP / Bulk Email on 4th Sept, another 
bulk mail() and sending 1000 emails to subscri.. both 12th June.

HTH
Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Image resize

2002-10-13 Thread Christian Ista

Hello,

I have an image (selected via a form), I know the original size of this
picture 800x600. I'd like when I put the files in the database resize to
240x180, or 120x90. 

How do that ?


Bye



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Fatal error: Maximum execution time of 30 seconds exceeded

2002-10-13 Thread Sascha Cunz

Yet another very fine way to do this job, is to set up a mailinglist manager 
(ezmlm i.e.), whom you subscribe all your recipients - And then send just one 
mail to the mailinglist manager.

Of course, works only if you got control to the server.

--Sascha

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] compiling mailparse into PHP

2002-10-13 Thread Jeff Schwartz


I'm having trouble adding mailparse to my PHP 4.2.3 install. 

I've downloaded and uncompressed mailparse-4.2.0.tgz into a subdir of my PHP directory 
and added --enable-mailparse to my config file but I'm still missing something.

What am I doing wrong?

Jeff



-
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos,  more
faith.yahoo.com


[PHP] Odd Problem

2002-10-13 Thread Stephen

Hello,

I'm running a script that inserts a form's contents into a MySQL table. However, when 
I insert the contents, I get an error telling me this:

Unknown column 'employee' in 'field list'

I can't find the problem. I have a field in my table called employee but I guess it 
doesn't see it. Any ideas why?

Thanks,
Stephen Craton
http://www.melchior.us
http://php.melchior.us


RE: [PHP] A little help needed, I cant figure!

2002-10-13 Thread David Freeman


  Song Table:
  Song_id
  A_id
  Type
  Name
  Length
  Lyrics
  ...
  
  That's my ideas on how to do it. There are many ways to do 
  it, though.
  
  Totally agree with what John says. If the lyrics are long 
  (as I assume 
  they will be) then I'd probably hive the lyrics off into a table of 
  their own with as many records as needed to make up one 
  song. The song 
  table would then become:
  
  Song Table:
  Song_id
  A_id
  Type
  Name
  Length
  Lyric_id
  
  and have a lyrics table such as:
  
  Lyrics Table:
  Lyric_id
  sequence
  text

Hmm, just thinking about normalizing the data and I suspect that the
song table will be insufficient if you have to take into account songs
that are released as a single and then also released on an album.  You
may find, in that circumstance, that having lookup tables will help.
One of these tables will contain artist ID's and associated song ID's
and enable you to get singles for an artist.  The other table would
contain album ID's and song ID's and enable you to get songs for an
album.  Obviously, you can get much more complex queries going as well
such as the number of times a particular song has been included on an
album by an artist.

This addition would also help with songs on compilation albums by
multiple artists where you could drill down to a list of songs on a
compilation album complete with the artist for each song.

CYA, Dave




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Odd Problem

2002-10-13 Thread John W. Holmes

Print your SQL to the screen and verify it's value is what you think it
is. Make sure it's accessing the right table. 

---John Holmes...

 -Original Message-
 From: Stephen [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, October 13, 2002 5:03 PM
 To: PHP List
 Subject: [PHP] Odd Problem
 
 Hello,
 
 I'm running a script that inserts a form's contents into a MySQL
table.
 However, when I insert the contents, I get an error telling me this:
 
 Unknown column 'employee' in 'field list'
 
 I can't find the problem. I have a field in my table called employee
but I
 guess it doesn't see it. Any ideas why?
 
 Thanks,
 Stephen Craton
 http://www.melchior.us
 http://php.melchior.us



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Simple HTML-Form Question

2002-10-13 Thread Lars H. Korte

Hi,
I've updated to PHP 4.2.3 and wrote this simple Script:

?
if (isset($name)) {
echo Hallo $name;
}
else {
echo FORM action='test.php' method=get
input type=text name=name
input type=submit name=action value=sendit;
}
?

I would expect the following:
The site starts with the form, then I enter my name (Lars) and click the
send-button. Then the script says Hello Lars.

The actual output is:
The site starts with the form, I enter my name and click the button, then
the form keeps being there, no Hello-message.

Has there changed something in PHP-Coding since I've learned it a few years
before?

There seems to be a diffrence between clicking the send button and pressing
Enter. Has this always been so?

regards
Lars




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] A little help needed, I cant figure!

2002-10-13 Thread Randum Ian

Indeed, another problem I have is that if a single is on an album, which
track it is on the album.

I want to centre the site on the Charts that are generated weekly for
singles and albums so if I use that as my source for the lookup and then
have the data contained in separate fields that are linked to this
table. Will that be making things easier or harder?

-Original Message-
From: David Freeman [mailto:[EMAIL PROTECTED]] 
Sent: 13 October 2002 22:12
To: [EMAIL PROTECTED]
Subject: RE: [PHP] A little help needed, I cant figure!


  Song Table:
  Song_id
  A_id
  Type
  Name
  Length
  Lyrics
  ...
  
  That's my ideas on how to do it. There are many ways to do 
  it, though.
  
  Totally agree with what John says. If the lyrics are long 
  (as I assume 
  they will be) then I'd probably hive the lyrics off into a table of 
  their own with as many records as needed to make up one 
  song. The song 
  table would then become:
  
  Song Table:
  Song_id
  A_id
  Type
  Name
  Length
  Lyric_id
  
  and have a lyrics table such as:
  
  Lyrics Table:
  Lyric_id
  sequence
  text

Hmm, just thinking about normalizing the data and I suspect that the
song table will be insufficient if you have to take into account songs
that are released as a single and then also released on an album.  You
may find, in that circumstance, that having lookup tables will help.
One of these tables will contain artist ID's and associated song ID's
and enable you to get singles for an artist.  The other table would
contain album ID's and song ID's and enable you to get songs for an
album.  Obviously, you can get much more complex queries going as well
such as the number of times a particular song has been included on an
album by an artist.

This addition would also help with songs on compilation albums by
multiple artists where you could drill down to a list of songs on a
compilation album complete with the artist for each song.

CYA, Dave




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Simple HTML-Form Question

2002-10-13 Thread Sascha Cunz

register_globals defaults now to off. Use the superglobals instead.
?
if (isset($_GET['name'])) {
echo Hallo .$GET['name'];
}
else {
echo FORM action='test.php' method=get
input type=text name=name
input type=submit name=action value=sendit;
}
?

Sascha

Am Sonntag, 13. Oktober 2002 23:40 schrieb Lars H. Korte:
 Hi,
 I've updated to PHP 4.2.3 and wrote this simple Script:

 ?
 if (isset($name)) {
 echo Hallo $name;
 }
 else {
 echo FORM action='test.php' method=get
 input type=text name=name
 input type=submit name=action value=sendit;
 }
 ?

 I would expect the following:
 The site starts with the form, then I enter my name (Lars) and click the
 send-button. Then the script says Hello Lars.

 The actual output is:
 The site starts with the form, I enter my name and click the button, then
 the form keeps being there, no Hello-message.

 Has there changed something in PHP-Coding since I've learned it a few years
 before?

 There seems to be a diffrence between clicking the send button and pressing
 Enter. Has this always been so?

 regards
 Lars


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] A little help needed, I cant figure!

2002-10-13 Thread David Freeman


  Indeed, another problem I have is that if a single is on an 
  album, which track it is on the album.

Off hand, I'd say that if you need this information as well (ie. You
want to recreate the songs on album list in the correct order) then
you need to extend one of your tables to include this information.  I'd
be looking to include album order in the song id, album id lookup table
and then using that column for sorting.

  I want to centre the site on the Charts that are generated weekly for
  singles and albums so if I use that as my source for the 
  lookup and then
  have the data contained in separate fields that are linked to this
  table. Will that be making things easier or harder?

There's no easy answer to that.  Much depends on what information you
want to be able to derive from the raw data.  If all you need is to be
able to drag out weekly charts then your database schema need not be all
that complex.  If you want to make it possible to cross reference
between singles and albums and let people, for example, find out which
album a single was on when they are looking at a singles chart then
you'll certainly need more information.  Ultimately, it's going to be a
trade-off between the information you want to be able to provide and the
complexity of the database to provide that capability.

CYA, Dave




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Simple HTML-Form Question

2002-10-13 Thread Chip Wiegand

Sascha Cunz wrote this stuff back on Mon, 14 Oct 2002 00:09:58 +0200:

 register_globals defaults now to off. Use the superglobals instead.
 ?
 if (isset($_GET['name'])) {
 echo Hallo .$GET['name'];
 }
 else {
 echo FORM action='test.php' method=get
 input type=text name=name
 input type=submit name=action value=sendit;
 }
 ? 
 Sascha

The value of name for the submit button is wrong - it should be the same
as the value you gave the isset statement, in this case it should be
input type=submit name=name value=sendit
Better yet is to use isset($submit) and the value for the submit
statement is also name=submit -
input type=submit name=submit value=sendit
of course value is optional. So you end up with this -

?
if (isset($_GET['submit'])) 
{
echo Hallo .$GET['name'];
}
else 
{
echo FORM action='test.php' method=get
input type='text' name='name'
input type='submit' name='submit' value='sendit';
}
? 
--
Chip

 Am Sonntag, 13. Oktober 2002 23:40 schrieb Lars H. Korte:
  Hi,
  I've updated to PHP 4.2.3 and wrote this simple Script:
 
  ?
  if (isset($name)) {
  echo Hallo $name;
  }
  else {
  echo FORM action='test.php' method=get
  input type=text name=name
  input type=submit name=action value=sendit;
  }
  ?
 
  I would expect the following:
  The site starts with the form, then I enter my name (Lars) and click
  the send-button. Then the script says Hello Lars.
 
  The actual output is:
  The site starts with the form, I enter my name and click the button,
  then the form keeps being there, no Hello-message.
 
  Has there changed something in PHP-Coding since I've learned it a
  few years before?
 
  There seems to be a diffrence between clicking the send button and
  pressing Enter. Has this always been so?
 
  regards
  Lars
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Simple HTML-Form Question

2002-10-13 Thread Sascha Cunz

This beautifies it (even makes it a bit more secure), but one doesn't need it 
really; should have worked without these changes, too. (Of course, it's 
better to include these changes)

Sascha

 The value of name for the submit button is wrong - it should be the same
 as the value you gave the isset statement, in this case it should be
 input type=submit name=name value=sendit
 Better yet is to use isset($submit) and the value for the submit
 statement is also name=submit -
 input type=submit name=submit value=sendit
 of course value is optional. So you end up with this -

 ?
 if (isset($_GET['submit']))
   {
   echo Hallo .$GET['name'];
   }
 else
   {
   echo FORM action='test.php' method=get
   input type='text' name='name'
   input type='submit' name='submit' value='sendit';
   }
 ?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] $HTTP_GET_VARS within a function ??

2002-10-13 Thread John Negretti

Hello All,

I am calling a particular function.  Within that function I need access
to the $HTTP_GET_VARS array.  It seem I could only access that array if I
pass it as a parameter of the function.  Is this how it's supposed to work.
Thanks for any direction.  NOTE: I am using PHP 4.0.6.

  John Negretti
  www.ideablue.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $HTTP_GET_VARS within a function ??

2002-10-13 Thread Marco Tabini

Try using 

global $HTTP_GET_VARS;

at the beginning of your function. $HTTP_GET_VARS has global scope, and
by default PHP isolates functions from the parent scope.


Marco

On Sun, 2002-10-13 at 16:39, John Negretti wrote:
 Hello All,
 
 I am calling a particular function.  Within that function I need access
 to the $HTTP_GET_VARS array.  It seem I could only access that array if I
 pass it as a parameter of the function.  Is this how it's supposed to work.
 Thanks for any direction.  NOTE: I am using PHP 4.0.6.
 
   John Negretti
   www.ideablue.com
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] global variable preference for self

2002-10-13 Thread Thoenen, Peter Mr. EPS

Anybody have reason for using $_SERVER['PHP_SELF'] -v- $_SERVER['URL'] ?
They both seem to always be the same in every instance I have seen so
curious is their is a preferance for one or the other and if there is a case
where PHP_SELF!=URL

Cheers,

-Peter

##
Peter Thoenen - Systems Programmer
Commercial Communications
Camp Bondsteel, Kosovo
##

Stumbled Upon...heh (Score:5, Funny) /.
by $carab on 23:00 23 August 2002 (#4131637)

ForensicTec officials said they stumbled upon the military networks about
two months ago, while checking on network security for a private-sector
client.

Someone new to a Dvorak probably tried to type in lynx
http://www.google.com; but instead got nmap -v -p 1-1024 -sS -P0 army.mil
-T paranoid.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




php-general Digest 14 Oct 2002 00:03:11 -0000 Issue 1642

2002-10-13 Thread php-general-digest-help


php-general Digest 14 Oct 2002 00:03:11 - Issue 1642

Topics (messages 119783 through 119819):

Re: Upload Problem
119783 by: Sascha Cunz

Re: Predefined variables not set?
119784 by: Sascha Cunz
119801 by: Oscar F
119802 by: Mark Charette

Re: A little help needed, I cant figure!
119785 by: John W. Holmes
119797 by: Chris Hewitt
119809 by: David Freeman
119812 by: Randum Ian
119814 by: David Freeman

Re: newline in string
119786 by: John W. Holmes
119793 by: Shawn McKenzie

Re: php cgi question
119787 by: David Cook
119788 by: Marco Tabini
119790 by: David Cook
119794 by: Marco Tabini

Re: PHP/mySQL help or advice
119789 by: Marco Tabini

about mssql.
119791 by: php
119792 by: John W. Holmes

People who searched this also searched this!
119795 by: Randum Ian

How to access MS ACCESS's database files
119796 by: php

Re: php 4.3.0pre and openssl 0.96g compile error
119798 by: Tony Earnshaw

Fatal error: Maximum execution time of 30 seconds exceeded
119799 by: scott
119800 by: John W. Holmes
119803 by: Thoenen, Peter  Mr.  EPS
119804 by: Chris Hewitt
119806 by: Sascha Cunz

Image resize
119805 by: Christian Ista

compiling mailparse into PHP
119807 by: Jeff Schwartz

Odd Problem
119808 by: Stephen
119810 by: John W. Holmes

Simple HTML-Form Question
119811 by: Lars H. Korte
119813 by: Sascha Cunz
119815 by: Chip Wiegand
119816 by: Sascha Cunz

$HTTP_GET_VARS within a function ??
119817 by: John Negretti
119818 by: Marco Tabini

global variable preference for self
119819 by: Thoenen, Peter  Mr.  EPS

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---

Hi,
as far as i can follow you, you want to:
  1. copy a file from position a to position b.
  2. read it from position b.
  3. and delete it at position b.

Why not read it directly from position a?
So what about:
  $content = implode(br, file($userfile));

Anyway: You should initialize $i in any way, best with zero - $i=0; before 
the while loop.
You check if 0.tab 1.tab 2.tab; if 2.tab exists, you create 3tab (A dot seems 
to be missing) $destfile .= '.tab'; instead of $destfile .= tab;

Is this script executed on unix? That would clearify why it could not find 
C:\\My Documents\\lyrics\\C_DTBS\\SLIME.TXT :-)

--Sascha

Am Sonntag, 13. Oktober 2002 12:15 schrieb [EMAIL PROTECTED]:
 I posted User Upload and with no advice I attempted to use the sources i
 could find and came up with the following:

 while (file_exists($i.tab)) {
 $i ++;
 }
 $destfile = $i;
 $destfile .= tab;
 stripslashes($userfile);
 copy($userfile, /uploads/ . $destfile);
 chdir(/uploads);
 $lines = file($destfile);
 $content = implode(br, $lines);
 unlink($destfile);
 echo($userfile_name);

 It doesnt work (surprise, surprise), what im trying to do is upload the
 file to my /uploads/ directory then read it and store it on the $content
 variable, then the content variable inserts a row into db (allready done),
 then I delete the file the while loop is to make sure I dont overwrite the
 file and make an error in my database.

 The errors PHP returns are:

 Warning: Unable to open 'C:\\My Documents\\lyrics\\C_DTBS\\SLIME.TXT' for
 reading: No such file or directory in /home/tabzilla/public_html/doadd.php
 on line 89

 Warning: ChDir: No such file or directory (errno 2) in
 /home/tabzilla/public_html/doadd.php on line 90

 Warning: file(tab) - No such file or directory in
 /home/tabzilla/public_html/doadd.php on line 91

 Warning: Bad arguments to implode() in /home/tabzilla/public_html/doadd.php
 on line 92

 Warning: unlink() failed (No such file or directory) in
 /home/tabzilla/public_html/doadd.php on line 93


 ANY HELP? ANYONE???


---End Message---
---BeginMessage---

Am Sonntag, 13. Oktober 2002 10:04 schrieb Miles:
 When trying to get $_SERVER[QUERY_STRING] I am getting 'Undefined index
 QUERY_STRING' error

 If there is a query string, e.g.  www.site.com/index.php?hello_world then
 it IS defined.  So it seems that PHP is complaining about undefined
 variables, rather than just outputting nothing.

 How can I fix this?  I've had no problems until i reinstalled php today...

I think on your prior installation, error reporting level was set lower than 
on your new installation. The better way is to fix the script, that this 
condition doesn't occur at all -- 
if (isset($_SERVER['QUERY_STRING'])) { ... }

Sascha

---End Message---
---BeginMessage---

I'm pretty sure it's not $_SERVER[QUERY_STRING], it's 
$_SERVER['QUERY_STRING'] (note the ' instead 

Re: [PHP] $HTTP_GET_VARS within a function ??

2002-10-13 Thread John Negretti

Marco,

I was reading that there were some security risks with
register-globals.  Is this the same thing as global.

John Negretti
www.ideablue.com


Marco Tabini [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Try using

 global $HTTP_GET_VARS;

 at the beginning of your function. $HTTP_GET_VARS has global scope, and
 by default PHP isolates functions from the parent scope.


 Marco

 On Sun, 2002-10-13 at 16:39, John Negretti wrote:
  Hello All,
 
  I am calling a particular function.  Within that function I need
access
  to the $HTTP_GET_VARS array.  It seem I could only access that array if
I
  pass it as a parameter of the function.  Is this how it's supposed to
work.
  Thanks for any direction.  NOTE: I am using PHP 4.0.6.
 
John Negretti
www.ideablue.com
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Detecting GD version

2002-10-13 Thread Owen Prime

Has anyone got any better ideas about how to detect what version of GD is 
running other than the following. The reason I ask is that I want to use 
imagecopyresampled() only if available ie. GD = v2.0.

OPTION 1.
Parse phpinfo() output for the GD version info. Expensive.

OPTION 2.
Run imagecopyresampled() suppressing errors and then check the error msg. 
ie:
imagecopyresampled();
if ($php_errormsg != imagecopyresampled(): requires GD 2.0 or later)
// GD = v2.0
} else {
// GD  v2.0
}

Option 2 is the best I can come up with at the moment luckily the 
requires GD 2.0 error message is triggered before the argument validation 
errors.

Anyone got a better idea?

Thanks,

Owen Prime
http://www.noggin.com.au

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Odd Problem

2002-10-13 Thread Stephen

I got the spelling and everything right...

- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
Newsgroups: php.general
To: 'Stephen' [EMAIL PROTECTED]; 'PHP List'
[EMAIL PROTECTED]
Sent: Sunday, October 13, 2002 4:17 PM
Subject: RE: [PHP] Odd Problem


 Print your SQL to the screen and verify it's value is what you think it
 is. Make sure it's accessing the right table.

 ---John Holmes...

  -Original Message-
  From: Stephen [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, October 13, 2002 5:03 PM
  To: PHP List
  Subject: [PHP] Odd Problem
 
  Hello,
 
  I'm running a script that inserts a form's contents into a MySQL
 table.
  However, when I insert the contents, I get an error telling me this:
 
  Unknown column 'employee' in 'field list'
 
  I can't find the problem. I have a field in my table called employee
 but I
  guess it doesn't see it. Any ideas why?
 
  Thanks,
  Stephen Craton
  http://www.melchior.us
  http://php.melchior.us




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Detecting GD version

2002-10-13 Thread Andrew Brampton

try function_exists('imagecopyresampled');

otherwise I'm sure there has to be some function that returns versions of
libs.

Andrew
- Original Message -
From: Owen Prime [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 14, 2002 1:37 AM
Subject: [PHP] Detecting GD version


 Has anyone got any better ideas about how to detect what version of GD is
 running other than the following. The reason I ask is that I want to use
 imagecopyresampled() only if available ie. GD = v2.0.

 OPTION 1.
 Parse phpinfo() output for the GD version info. Expensive.

 OPTION 2.
 Run imagecopyresampled() suppressing errors and then check the error msg.
 ie:
 @imagecopyresampled();
 if ($php_errormsg != imagecopyresampled(): requires GD 2.0 or later)
 // GD = v2.0
 } else {
 // GD  v2.0
 }

 Option 2 is the best I can come up with at the moment luckily the
 requires GD 2.0 error message is triggered before the argument
validation
 errors.

 Anyone got a better idea?

 Thanks,

 Owen Prime
 http://www.noggin.com.au

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Detecting GD version

2002-10-13 Thread Owen Prime

Been there. The function still exists in GD  2.0. Thats why it produces 
such a specific error message. Otherwise it would say function doesn't 
exist.

Thanks for you input anyways.

Cheers,

Owen Prime
http://www.noggin.com.au


Andrew Brampton wrote:

 try function_exists('imagecopyresampled');
 
 otherwise I'm sure there has to be some function that returns versions of
 libs.
 
 Andrew
 - Original Message -
 From: Owen Prime [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, October 14, 2002 1:37 AM
 Subject: [PHP] Detecting GD version
 
 
 Has anyone got any better ideas about how to detect what version of GD is
 running other than the following. The reason I ask is that I want to use
 imagecopyresampled() only if available ie. GD = v2.0.

 OPTION 1.
 Parse phpinfo() output for the GD version info. Expensive.

 OPTION 2.
 Run imagecopyresampled() suppressing errors and then check the error msg.
 ie:
 @imagecopyresampled();
 if ($php_errormsg != imagecopyresampled(): requires GD 2.0 or later)
 // GD = v2.0
 } else {
 // GD  v2.0
 }

 Option 2 is the best I can come up with at the moment luckily the
 requires GD 2.0 error message is triggered before the argument
 validation
 errors.

 Anyone got a better idea?

 Thanks,

 Owen Prime
 http://www.noggin.com.au

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] OCIFetchInto: OCI8 problem

2002-10-13 Thread Faisal Abdullah

Hi ppl.
I have something which seems really odd.

I run a SQL query, which is supposed to return 2 rows, but instead, it
returns one with
OCIFetchInto(). I used the exact same query in SQL*Plus, and It returns 2
rows like I want them.

Here's the code.


if(!$iDBConn = OCILogon(DB_USER, DB_PASS, DB_NAME))
echo Failed to connect to Oracle databasebr;

$stmt = OCIParse($iDBConn,ALTER SESSION SET NLS_DATE_FORMAT='-MM-DD');
 OCIExecute($stmt,OCI_DEFAULT);

$orasql = SELECT * FROM gaj_ledjer_potongan WHERE no_gaji =
'.$id[salary_no].
'  AND kod_potongan = '09' AND tempoh_gaji LIKE '$year%';

echo $orasql.br;
$iStatement = OCIParse($iDBConn, $orasql);
OCIExecute($iStatement, OCI_DEFAULT);
$arrError = OCIError($iStatement);

if ($arrError['code']) {
print $arrError['message'];
exit;
}

$total_ded_sal = 0;
$deduction = $id[deduction];
while(OCIFetchInto($iStatement, $ora, OCI_ASSOC+OCI_RETURN_NULLS)) {
echo $ora['TEMPOH_GAJI'].br;
}

p/s - I tried using a select * from table, and it returns more than one
rows(i suppose all the rows).

Thanks.

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




  1   2   >