RE: [PHP] Re: Can't display PNG images
Thank you so much for your responses. Thanks for any response! I now the GD libraries with PNG support. However, the image is still broken. I looked at the apache server error log and this is what showed up when I run zero.php(See below): libpng warning: Application was compiled with png.h from libpng-1.0.8 libpng warning: Application is running with png.c from libpng-1.2.1 gd-png: fatal libpng error: Incompatible libpng version in application and library [Tue Mar 12 20:09:43 2002] [notice] child pid 30296 exit signal Segmentation fault (11) Action Taken o Deleted old lipng* files in /usr/lib o Compiled libpng-1.2.1 and installed it in: /usr/lib o recompiled and installed php 4.1.2(Upgraded from 4.1.1) -- CODE -- zero.php img src=one.php alt=a PHP generated image one.php --- ?php header(Content-type: image/png); $image = imagecreate( 200, 200 ); imagepng($image); ? -Original Message- From: Alastair Battrick [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 7:05 AM To: Jordan S. Jones; [EMAIL PROTECTED] Subject: RE: [PHP] Re: Can't display PNG images Echoing text to the screen is a very useful debugging tool when creating images from php, if you type the full location of the image script in the address bar, rather than specifying it as an image that is opened by a html page. If you do this Teresa, you should get the PHP error message, and if you give this to us it would help. Alastair Battrick Senior Developer Lightwood Consultancy Ltd http://www.lightwood.net -Original Message- From: Jordan S. Jones [mailto:[EMAIL PROTECTED]] Sent: 12 March 2002 11:29 To: [EMAIL PROTECTED] Subject: [PHP] Re: Can't display PNG images The icon essentially means that it was a broken image, or that they code did not work. I know that wasn't much help. On another point, in my opinion, it doesn't make a whole lot of logical sense to have a die(Error text) statement in code that creates an image.. If an error does occur, it will still display the same broken image icon. However, I am not the definitive word on the matter, and if you or anyone else has a different opinion on the matter, I would be more than happy to hear it. Jordan Teresa Narvaez [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, Background info: I'm running o PHP 4.1.1 on a linux server kernel(2.2.16). o Using Netscape Communicator 4.75 o Compiled and installed the gd(1.8.4) library Problem(2 problems): 1.- The following code won't display an image(I get an icon of some type of piece of paper). ?php header (Content-type: image/png); $im = @ImageCreate (50, 100) or die (Cannot Initialize new GD image stream); $background_color = ImageColorAllocate ($im, 255, 255, 255); $text_color = ImageColorAllocate ($im, 233, 14, 91); ImageString ($im, 1, 5, 5, A Simple Text String, $text_color); ImagePng ($im); ? 2.- The configure Command from phpinfo() is different than what I actually typed at the command line. Also, phpinfo() area for GD does not show PNG or JPEG support. why? from phpinfo() -- './configure' '--with-mysql' '--with-apxs=/var/apache/bin/apxs' '--with-gd=/home/builder/downloads/untarred/gd-1.8.4' '--enable-sockets' '--enable-calendar' '--enable-ftp' '--enable-trans-sid' What I typed at the command line: - ./configure --with-mysql --with-apxs=/var/apache/bin/apxs --with-gd=/home/builder/downloads/untarred/gd-1.8.4 --with-png-dir=/usr/lib --enable-gd-native-ttf --with-ttf --with-jpeg-dir=/home/builder/downloads/untarred/jpeg-6b --with-t1lib=/home/builder/downloads/untarred/t1lib-1.3.1 --enable-sockets --with-zlib-dir --with-xpm-dir --enable-calenda r --enable-ftp --enable-trans-sid OUTPUT from phpinfo() --- GD Supportenabled GD Version1.6.2 or higher WBMP Support enabled I would really appretiate any ideas you could give me. Thanks in advance! -Teresa -- 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] mysql problems
I agree with Hugh. I think it is always a good idea to check for return values of any function call. So, I'd replace this line: $result = mysql_query(select * from table); with $result = mysql_query(select * from table); or die(Unable to connect to SQL server: . mysql_error()); -Teresa -Original Message- From: hugh danaher [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 8:27 PM To: Maarten Weyn; php Subject: Re: [PHP] mysql problems Maarten, Perhaps table isn't the name of the table you want. If mysql can't find the table (in line 13?), your $result variable is empty and this causes (line 17?) to fail also. Hope this helps, Hugh - Original Message - From: Maarten Weyn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 12, 2002 5:19 PM Subject: [PHP] mysql problems Hi on this code: $link = mysql_connect(localhost, login, passwd); mysql_select_db(table); $result = mysql_query(select * from table); while ($row = mysql_fetch_object($result)) { echo $row-ID; echo $row-Drank; } mysql_free_result($result); mysql_close($link); It resulst in Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\index.php on line 13 Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\index.php on line 17 line 13 = while ($row = mysql_fetch_object($result)) { line 17 = mysql_free_result($result); I'm running an Apache/1.3.23 on a win 2000 with PHP Version 4.1.2 and mysql 3.23.39. Does it not recoginze this mysql_... statements? Maarten -- 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] Can't display PNG images
Hello, Background info: I'm running o PHP 4.1.1 on a linux server kernel(2.2.16). o Using Netscape Communicator 4.75 o Compiled and installed the gd(1.8.4) library Problem(2 problems): 1.- The following code won't display an image(I get an icon of some type of piece of paper). ?php header (Content-type: image/png); $im = ImageCreate (50, 100) or die (Cannot Initialize new GD image stream); $background_color = ImageColorAllocate ($im, 255, 255, 255); $text_color = ImageColorAllocate ($im, 233, 14, 91); ImageString ($im, 1, 5, 5, A Simple Text String, $text_color); ImagePng ($im); ? 2.- The configure Command from phpinfo() is different than what I actually typed at the command line. Also, phpinfo() area for GD does not show PNG or JPEG support. why? from phpinfo() -- './configure' '--with-mysql' '--with-apxs=/var/apache/bin/apxs' '--with-gd=/home/builder/downloads/untarred/gd-1.8.4' '--enable-sockets' '--enable-calendar' '--enable-ftp' '--enable-trans-sid' What I typed at the command line: - ./configure --with-mysql --with-apxs=/var/apache/bin/apxs --with-gd=/home/builder/downloads/untarred/gd-1.8.4 --with-png-dir=/usr/lib --enable-gd-native-ttf --with-ttf --with-jpeg-dir=/home/builder/downloads/untarred/jpeg-6b --with-t1lib=/home/builder/downloads/untarred/t1lib-1.3.1 --enable-sockets --with-zlib-dir --with-xpm-dir --enable-calendar --enable-ftp --enable-trans-sid OUTPUT from phpinfo() --- GD Supportenabled GD Version1.6.2 or higher WBMP Support enabled I would really appretiate any ideas you could give me. Thanks in advance! -Teresa
RE: [PHP] Unable to display images on browser
Hello, Thanks for your responses; however, I do not think I have the gd libraries installed because ImageCreateFromString() was not found. I will install it. I have a question: I can display the PNG or GIF image using the browser. So Why do I need the GD library? Since I store the mime type in the database I think that a call to header() to tell the browser what type of mime-type is coming from the database should sufice. Also, I want to store any type of binary data into my database (PNG, GIF, word, JPG, etc) Am I missing something? Thanks, -Teresa -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 4:12 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Unable to display images on browser You need to insert the following lines after this line: Header(Content-type: image/gif); $im = ImageCreateFromString ($fileContent); ImageGif ($im); and then remove this line: echo $fileContent; That should do it. /Joakim -Original Message- From: Narvaez, Teresa [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 8:32 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP] Unable to display images on browser Hello, Thanks for your help. This is what I have for file1.php and ddownloadfile.php. What I want is to click on Donwnload now link and be able to get the file out of the database and display it on the browser. Thank you in adavance, -Teresa file1.php --- ?php while ($row = mysql_fetch_array($result)) { ? SOME_HTLM_CODE_TO_DISPLAY_DB_FIELDS_GOES_HERE; // img src=\ddownloadfile.php?fileId=?php echo $row[PicNum]; ?\ a href=ddownloadfile.php?fileId=?php echo $row[PicNum]; ? Download Now /a/font /td /tr ?php ddownloadfile.php -- ? $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); echo Sent Query successfullybr; if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); Header(Content-type: image/gif); echo $fileContent; } else { echo Record does not exist; } // else ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unable to display images on browser
Andrew, That is exactly what I am trying to do but the only thing I get is a box with an X on IE 4.0 and Netscape Communicator 4.73. Please see my a fragement of my php code below. Thanks in advance! -Teresa -- file1.php -- ?php while ($row = mysql_fetch_array($result)) { ? SOME_HTLM_CODE_TO_DISPLAY_DB_FIELDS_GOES_HERE; a href=ddownloadfile.php?fileId=?php echo $row[PicNum]; ? Download Now ?php } ? -- ddownloadfile.php -- ? $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); echo Sent Query successfullybr; if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); // Header(Content-type: image/gif); Header(Content-type: $fileType); echo $fileContent; } else { echo Record does not exist; } // else ? -Original Message- From: Andrew Brampton [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 5:08 PM To: Narvaez, Teresa; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Unable to display images on browser if u have the data stored in the DB, just chuck the data out, with the correct mime-type header.. Andrew -- - Original Message - From: Narvaez, Teresa [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, March 01, 2002 8:41 PM Subject: RE: [PHP] Unable to display images on browser Hello, Thanks for your responses; however, I do not think I have the gd libraries installed because ImageCreateFromString() was not found. I will install it. I have a question: I can display the PNG or GIF image using the browser. So Why do I need the GD library? Since I store the mime type in the database I think that a call to header() to tell the browser what type of mime-type is coming from the database should sufice. Also, I want to store any type of binary data into my database (PNG, GIF, word, JPG, etc) Am I missing something? Thanks, -Teresa -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 4:12 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Unable to display images on browser You need to insert the following lines after this line: Header(Content-type: image/gif); $im = ImageCreateFromString ($fileContent); ImageGif ($im); and then remove this line: echo $fileContent; That should do it. /Joakim -Original Message- From: Narvaez, Teresa [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 8:32 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP] Unable to display images on browser Hello, Thanks for your help. This is what I have for file1.php and ddownloadfile.php. What I want is to click on Donwnload now link and be able to get the file out of the database and display it on the browser. Thank you in adavance, -Teresa file1.php --- ?php while ($row = mysql_fetch_array($result)) { ? SOME_HTLM_CODE_TO_DISPLAY_DB_FIELDS_GOES_HERE; // img src=\ddownloadfile.php?fileId=?php echo $row[PicNum]; ?\ a href=ddownloadfile.php?fileId=?php echo $row[PicNum]; ? Download Now /a/font /td /tr ?php ddownloadfile.php -- ? $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); echo Sent Query successfullybr; if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); Header(Content-type: image/gif); echo $fileContent; } else { echo Record does not exist; } // else ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unable to display images on browser
Hello, Thanks for your help. This is what I have for file1.php and ddownloadfile.php. What I want is to click on Donwnload now link and be able to get the file out of the database and display it on the browser. Thank you in adavance, -Teresa file1.php --- ?php while ($row = mysql_fetch_array($result)) { ? SOME_HTLM_CODE_TO_DISPLAY_DB_FIELDS_GOES_HERE; // img src=\ddownloadfile.php?fileId=?php echo $row[PicNum]; ?\ a href=ddownloadfile.php?fileId=?php echo $row[PicNum]; ? Download Now /a/font /td /tr ?php ddownloadfile.php -- ? $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); echo Sent Query successfullybr; if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); Header(Content-type: image/gif); echo $fileContent; } else { echo Record does not exist; } // else ? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 4:56 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Unable to display images on browser Well, you probably need to do something like this: file1.php (where you want to display an image) img src=getimage.php?fileId=42 end file1 getimage.php (the ? needs to be on the first line in the file) ? Code to connect and selected DB not included - $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); // Header(Content-type: $fileType); header (Content-type: image/gif); $im = ImageCreateFromString ($fileContent); ImageGif ($im); } else { //Insert code to display error.gif } // else ? ---end getimage.php Good Luck /Joakim -Original Message- From: Narvaez, Teresa [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 2:08 AM To: 'Dean Householder'; [EMAIL PROTECTED] Subject: [PHP] Unable to display images on browser Hello, I do not understand why I can't display images retrieved from MySQL on my browser(IE 4.0). When I retrieve the image from MYSQL I set the Header function to change the type of content(image/gif) I am sending to the browser. However, the browser displays an box with an X in it. I would greatly appretiate any ideas/help. Here is the piece of code: Thanks in advance! -Teresa ? Code to connect and selected DB not included - $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); echo Sent Query successfullybr; if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); // Header(Content-type: $fileType); Header(Content-type: image/gif); echo $fileContent; } else { echo Record does not exist; } // else ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unable to display images on browser
Hello, I do not understand why I can't display images retrieved from MySQL on my browser(IE 4.0). When I retrieve the image from MYSQL I set the Header function to change the type of content(image/gif) I am sending to the browser. However, the browser displays an box with an X in it. I would greatly appretiate any ideas/help. Here is the piece of code: Thanks in advance! -Teresa ? Code to connect and selected DB not included - $dbQuery = Select PicNum, size, type, description, Image; $dbQuery .= FROM Images WHERE PicNum = $fileId; $result = mysql_query($dbQuery) or die (Could not get file list: . mysql_error() ); echo Sent Query successfullybr; if ( mysql_num_rows($result) == 1) { $fileType = @mysql_result($result,0, type); $fileContent = @mysql_result($result, 0, Image); $filedesc = @mysql_result($result,0, description); $filenum = @mysql_result($result,0, PicNum); // Header(Content-type: $fileType); Header(Content-type: image/gif); echo $fileContent; } else { echo Record does not exist; } // else ?
RE: [PHP] Re: NULL value for variable
Hello, Thanks for your replies. I still cannot access the variable fileId :-(. I would appreatiate any more comments. Thanks in advance -Teresa Warning: Undefined index: fileId in /home/narvaez/public_html/ddownloadfile.php on line 6 Warning: Undefined variable: fileId in /home/narvaez/public_html/ddownloadfile.php on line 7 Warning: Undefined variable: fileId in /home/narvaez/public_html/ddownloadfile.php on line 8 Invalid PictureNumber specified: () one.php td width=33% bgcolor=#FFDCA8 height=21 p style=margin-left: 10 font face=Verdana size=1 a href=downloadfile.php?fileId=?php echo $row[PicNum]; ? Download Now /a/font /td /tr downloadfile.php ? print_r ($_REQUEST['fileId']); if ( ! is_numeric($fileId) ) die (Invalid PictureNumber specified: ($fileId)); ? -Original Message- From: Lars Torben Wilson [SMTP:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 1:52 PM To: Andrey Hristov Cc: Narvaez, Teresa; [EMAIL PROTECTED] Subject: Re: [PHP] Re: NULL value for variable On Thu, 2002-02-21 at 08:16, Andrey Hristov wrote: It seems that you use global where it is not needed- outside of any function First error because error_reporting is not set to 0 in php.ini so error_reporting valus includes E_WARNING. if you set error_reporting=0 in php.ini or error_reporting(0); in the script you will not receive the first warning but probably lose the second which is useful. Best regards, Andrey Hristov Turning error_reporting() off while developing is probably one of the easiest ways to make your life suck--but to each his own. :) In this case, it's probably pointing right to the problem. What do you get from using 'print_r($_REQUEST)'? You should be able to access $_REQUEST['fileId']; Torben - Original Message - From: Narvaez, Teresa [EMAIL PROTECTED] To: 'Sanduhr' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, February 21, 2002 6:05 PM Subject: RE: [PHP] Re: NULL value for variable I comment it out but I got this error: Warning: Undefined variable: fileId in /home/narvaez/public_html/ddownloadfile.php on line 22 Could not get file list: You have an error in your SQL syntax near '' at line 1 Thanks for any help!. -Original Message- From: Sanduhr [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 6:58 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: NULL value for variable that global $fileId; shouldn't be there in downloadfile.php Teresa Narvaez [EMAIL PROTECTED] schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... : Hello, : I am runnig php 4.1.1. In the configuration, register_globals is : ON. : I have two programs and I want to pass the value from fileId from one.php to : downloadfile.php. However, in downloadfile.php $fileId is NULL. What am I : missing? Thanks, -Teresa : : : one.php : td width=33% bgcolor=#FFDCA8 height=21 : p style=margin-left: 10 : font face=Verdana size=1 : a href=downloadfile.php?fileId=?php echo $row[PicNum]; ? : Download Now : /a/font : /td : /tr : : downloadfile.php : ? : global $fileId; : : if ( ! is_numeric($fileId) ) : die (Invalid PictureNumber specified: ($fileId)); : : ? : : -- 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 -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506
[PHP] NULL value for variable
Hello, I am runnig php 4.1.1. In the configuration, register_globals is ON. I have two programs and I want to pass the value from fileId from one.php to downloadfile.php. However, in downloadfile.php $fileId is NULL. What am I missing? Thanks, -Teresa one.php td width=33% bgcolor=#FFDCA8 height=21 p style=margin-left: 10 font face=Verdana size=1 a href=downloadfile.php?fileId=?php echo $row[PicNum]; ? Download Now /a/font /td /tr downloadfile.php ? global $fileId; if ( ! is_numeric($fileId) ) die (Invalid PictureNumber specified: ($fileId)); ?
[PHP] NULL Apache environment variables
Hello, I'm running PHP version 4.1.1. When I invoke this function, ?php phpinfo()?, all variables are set. However, when I try to retrieve a value of a certain variable like this: ?php echo $HTTP_USER_AGENT; ? It returns NULL. Is there a missing configuration on apache or php? Thanks, -Teresa
RE: [PHP] NULL Apache environment variables
Thank you ... that worked! I did not know this because I looked at a sample in www.php.net and the sample fails to call getenv(). Thanks! -Teresa -Original Message- From: Neil Freeman [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 12:54 PM To: Narvaez, Teresa Cc: [EMAIL PROTECTED] Subject: Re: [PHP] NULL Apache environment variables Have a look at the function getenv().. eg: $ip = getenv (REMOTE_ADDR); // get the ip number of the user HTH Neil Narvaez, Teresa wrote: Hello, I'm running PHP version 4.1.1. When I invoke this function, ?php phpinfo()?, all variables are set. However, when I try to retrieve a value of a certain variable like this: ?php echo $HTTP_USER_AGENT; ? It returns NULL. Is there a missing configuration on apache or php? Thanks, -Teresa *** This message was virus checked with: SAVI 3.53 Jan 2002 last updated 30th January 2002 *** -- Email: [EMAIL PROTECTED] [EMAIL PROTECTED]
[PHP] PHP_SELF Undefined
When I execute the code below, why is PHP_SELF undefined? I will appretiate any help on this. I can get its value by: echo $_SERVER[PHP_SELF];Thanks in advance! -Teresa HTML HEAD TITLEFeedback/TITLE /HEAD BODY ? $form_block = FORM method=\POST\ action=\$PHP_SELF\ PYour Name:br INPUT type=\text\ name=\sender_name\ size=30/p PYour E-Mail Address:br INPUT type=\text\ name=\sender_email\ size=30/p PYour Message:br textarea name=\message\ cols=30 rows=5/textarea /p PINPUT type=\submit\ value=\Send This Form\/p /FORM ; ? /BODY /HTML
RE: [PHP] NULL Apache environment variables
The function call phpinfo() shows register_globals=off for master and local value on my system. I installed PHP and did not change anything because I do not know enough to make changes so I believe off is the default value. Thanks, -Teresa -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 5:58 PM To: Lars Torben Wilson Cc: Narvaez, Teresa; [EMAIL PROTECTED] Subject: Re: [PHP] NULL Apache environment variables On Monday, February 18, 2002, at 05:44 PM, Lars Torben Wilson wrote: On Mon, 2002-02-18 at 08:56, Narvaez, Teresa wrote: Hello, I'm running PHP version 4.1.1. When I invoke this function, ?php phpinfo()?, all variables are set. However, when I try to retrieve a value of a certain variable like this: ?php echo $HTTP_USER_AGENT; ? It returns NULL. Is there a missing configuration on apache or php? As of PHP 4.1.0, register_globals is off by default since globals are so icky. Try $_SERVER['HTTP_USER_AGENT']. This should probably be made more obvious in the docs. Hm? I didn't think that this was the case -- I thought that although there is a long-term move to making 'register_globals = off' default, register_globals is still default to be 'on'. I think that this is described in the 4.1.0 release announcement. http://www.php.net/release_4_1_0.php In the 4.1.1 release announcement, it doesn't say that anything about this has changed. I'm not trying to contradict you Torben, but if this is true then it is not documented in the news at the web site. Please correct me. - Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED]
RE: [PHP] NULL Apache environment variables
Erik, Thanks for your response. No I did not install a pre-compiled binary. I got the tar ball and compiled it myself. By the way, I am running PHP version 4.1.1. Thanks for all the help! -Teresa -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 6:45 PM To: Narvaez, Teresa Cc: [EMAIL PROTECTED] Subject: Re: [PHP] NULL Apache environment variables On Monday, February 18, 2002, at 06:11 PM, Narvaez, Teresa wrote: The function call phpinfo() shows register_globals=off for master and local value on my system. I installed PHP and did not change anything because I do not know enough to make changes so I believe off is the default value. Hm. That's very strange. Did you install someone else's pre-compiled binary? I know that my 4.1.0 source install ended up with register_globals = on by default, and I had to manually change this to off. But that was over a month ago. There are others on this list more knowledgeable than I about the default setup of the php.ini file. In any event Teresa, you are much better off learning PHP with register_globals = off because it will get you used to using $_* arrays, as the old globalized means of accessing variables has been deprecated. So don't change anything. :) Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED]
RE: [PHP] Functions
Try the phpinfo() function: Example: htmlheadtitlePHP Test/title/head body ?php phpinfo()? /body/html -Teresa -Original Message- From: Jason Whitaker [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 4:15 PM To: [EMAIL PROTECTED] Subject: [PHP] Functions Is there a website that lists all the default functions and variables? EI: $REMOTE_ADDR AND $PHP_SELF -- Jason Whitaker -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php