php-general Digest 20 Feb 2005 21:48:40 -0000 Issue 3297
php-general Digest 20 Feb 2005 21:48:40 - Issue 3297 Topics (messages 209077 through 209091): php5 and globals? 209077 by: Mike 209078 by: M. Sokolewicz 209079 by: Guillermo Nouche [NEWBIE] Confused about usage of $_SERVER['DOCUMENT_ROOT'] 209080 by: Dave 209081 by: Mirco Blitz 209082 by: b1nary Developement Team 209083 by: Andre Dubuc 209084 by: Dave 209085 by: John Nichel 209086 by: b1nary Developement Team [NEWBIE] Cant get $_POST to work 209087 by: David Freedman 209089 by: John Nichel 209090 by: b1nary Developement Team Handling of partially completed forms 209088 by: Joseph E. Maxwell 209091 by: b1nary Developement Team 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: php-general@lists.php.net -- ---BeginMessage--- I have read that php5 does something different with global_vars. I know that many of my clients rely on them working. Will thinks start breaking after I upgrade from 4.3.10 to 5.3? TIA ---End Message--- ---BeginMessage--- Mike wrote: I have read that php5 does something different with global_vars. I know that many of my clients rely on them working. Will thinks start breaking after I upgrade from 4.3.10 to 5.3? TIA something different being...? maybe you mean register_globals? that change goes back to php 4.2.0, but they're not planning to remove it from php anytime soon, due to the fact that so many people still rely on it ---End Message--- ---BeginMessage--- On Sun, 20 Feb 2005 15:14:27 +0100, M. Sokolewicz [EMAIL PROTECTED] wrote: Mike wrote: I have read that php5 does something different with global_vars. I know that many of my clients rely on them working. Will thinks start breaking after I upgrade from 4.3.10 to 5.3? TIA something different being...? maybe you mean register_globals? that change goes back to php 4.2.0, but they're not planning to remove it from php anytime soon, due to the fact that so many people still rely on it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Now objects are global always, and always references. Is that the change you read? Good luck, -Guillermo ---End Message--- ---BeginMessage--- PHP General, The Situation: I would like to be able to specify locations of scripts and files relative to the root directory from which my web site is served. I thought this was what $_SERVER['DOCUMENT_ROOT'] was for. The Problem: When I use $_SERVER['DOCUMENT_ROOT'], it creates a path starting from somewhere deep down in the server's file structure, below where I even have authorized access. So if I specify a file like so: $imageFile = $_SERVER['DOCUMENT_ROOT'] . /images/image.jpg; ... PHP gets lost and doesn't locate it. What I am looking for is a variable which will specify the base directory that my web site is rooted in. In other words, starting from the same directory that my index.html file is in. The Question: How do I specify the directory that my web site is situated in, the same directory where my main index.html file is? Is there a different variable I should be using, or perhaps some configuration of $_SERVER['DOCUMENT_ROOT'] that needs to be applied? What I've Tried So Far: First I went to the on line PHP manual, which is where I found out about $_SERVER['DOCUMENT_ROOT'] in the first place. Of all the server variables available, 'DOCUMENT_ROOT' seems to describe what I'm looking for, but doesn't behave how I would expect. A Google search was equally ineffective in educating me in what basic concept I am missing. Any advice would be much appreciated. -- Dave Gutteridge [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- Hi, what does echo $imageFile print and what do you do afterwards with it. Probably there is the error. Mit freundlichen Grüßen Mirco Blitz -Ursprüngliche Nachricht- Von: Dave [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 20. Februar 2005 18:15 An: php-general Betreff: [PHP] [NEWBIE] Confused about usage of $_SERVER['DOCUMENT_ROOT'] PHP General, The Situation: I would like to be able to specify locations of scripts and files relative to the root directory from which my web site is served. I thought this was what $_SERVER['DOCUMENT_ROOT'] was for. The Problem: When I use $_SERVER['DOCUMENT_ROOT'], it creates a path starting from somewhere deep down in the server's file structure, below where I even have authorized access. So if I specify a file like so: $imageFile = $_SERVER['DOCUMENT_ROOT'] . /images/image.jpg; ... PHP gets lost and doesn't locate it. What I am looking for is a variable which will specify the base directory
Re: [PHP] XHTML 1.1 + php sessions = :(
Jason Barnett wrote: Not an idiot... we all had to learn it once. And some of us a few times more than that! You're welcome. Jason Okay, back to business... Here's what I've got in the method that goes at the top of the page *function headers() {* *header(Content-type: text/html; charset=utf-8);* *ini_set(session.name,b1naryses);* *ini_set(session.use_only_cookies,1);* *session_start();* *}* I know I have the ini_set(); syntax correct because it succesfully changes the session name from PHPSESSID to b1naryses, however when I go to validate it, the session ID is still being passed through the URL. I read a whole bunch of stuff on php.net about sessions and ini_set(), however I can't really find anything to solve this. Is it possible that some setting on my host's server is causing this?
[PHP] php5 and globals?
I have read that php5 does something different with global_vars. I know that many of my clients rely on them working. Will thinks start breaking after I upgrade from 4.3.10 to 5.3? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php5 and globals?
Mike wrote: I have read that php5 does something different with global_vars. I know that many of my clients rely on them working. Will thinks start breaking after I upgrade from 4.3.10 to 5.3? TIA something different being...? maybe you mean register_globals? that change goes back to php 4.2.0, but they're not planning to remove it from php anytime soon, due to the fact that so many people still rely on it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php5 and globals?
On Sun, 20 Feb 2005 15:14:27 +0100, M. Sokolewicz [EMAIL PROTECTED] wrote: Mike wrote: I have read that php5 does something different with global_vars. I know that many of my clients rely on them working. Will thinks start breaking after I upgrade from 4.3.10 to 5.3? TIA something different being...? maybe you mean register_globals? that change goes back to php 4.2.0, but they're not planning to remove it from php anytime soon, due to the fact that so many people still rely on it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Now objects are global always, and always references. Is that the change you read? Good luck, -Guillermo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [NEWBIE] Confused about usage of $_SERVER['DOCUMENT_ROOT']
PHP General, The Situation: I would like to be able to specify locations of scripts and files relative to the root directory from which my web site is served. I thought this was what $_SERVER['DOCUMENT_ROOT'] was for. The Problem: When I use $_SERVER['DOCUMENT_ROOT'], it creates a path starting from somewhere deep down in the server's file structure, below where I even have authorized access. So if I specify a file like so: $imageFile = $_SERVER['DOCUMENT_ROOT'] . /images/image.jpg; ... PHP gets lost and doesn't locate it. What I am looking for is a variable which will specify the base directory that my web site is rooted in. In other words, starting from the same directory that my index.html file is in. The Question: How do I specify the directory that my web site is situated in, the same directory where my main index.html file is? Is there a different variable I should be using, or perhaps some configuration of $_SERVER['DOCUMENT_ROOT'] that needs to be applied? What I've Tried So Far: First I went to the on line PHP manual, which is where I found out about $_SERVER['DOCUMENT_ROOT'] in the first place. Of all the server variables available, 'DOCUMENT_ROOT' seems to describe what I'm looking for, but doesn't behave how I would expect. A Google search was equally ineffective in educating me in what basic concept I am missing. Any advice would be much appreciated. -- Dave Gutteridge [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] [NEWBIE] Confused about usage of $_SERVER['DOCUMENT_ROOT']
Hi, what does echo $imageFile print and what do you do afterwards with it. Probably there is the error. Mit freundlichen Grüßen Mirco Blitz -Ursprüngliche Nachricht- Von: Dave [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 20. Februar 2005 18:15 An: php-general Betreff: [PHP] [NEWBIE] Confused about usage of $_SERVER['DOCUMENT_ROOT'] PHP General, The Situation: I would like to be able to specify locations of scripts and files relative to the root directory from which my web site is served. I thought this was what $_SERVER['DOCUMENT_ROOT'] was for. The Problem: When I use $_SERVER['DOCUMENT_ROOT'], it creates a path starting from somewhere deep down in the server's file structure, below where I even have authorized access. So if I specify a file like so: $imageFile = $_SERVER['DOCUMENT_ROOT'] . /images/image.jpg; ... PHP gets lost and doesn't locate it. What I am looking for is a variable which will specify the base directory that my web site is rooted in. In other words, starting from the same directory that my index.html file is in. The Question: How do I specify the directory that my web site is situated in, the same directory where my main index.html file is? Is there a different variable I should be using, or perhaps some configuration of $_SERVER['DOCUMENT_ROOT'] that needs to be applied? What I've Tried So Far: First I went to the on line PHP manual, which is where I found out about $_SERVER['DOCUMENT_ROOT'] in the first place. Of all the server variables available, 'DOCUMENT_ROOT' seems to describe what I'm looking for, but doesn't behave how I would expect. A Google search was equally ineffective in educating me in what basic concept I am missing. Any advice would be much appreciated. -- Dave Gutteridge [EMAIL PROTECTED] -- 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] [NEWBIE] Confused about usage of $_SERVER['DOCUMENT_ROOT']
What's Up Dave... yeah, regardless of how deep this goes into the servers file structure, it should pull out the same thing in the end. Please print out the response and let us know what happens. Dave wrote: PHP General, The Situation: I would like to be able to specify locations of scripts and files relative to the root directory from which my web site is served. I thought this was what $_SERVER['DOCUMENT_ROOT'] was for. The Problem: When I use $_SERVER['DOCUMENT_ROOT'], it creates a path starting from somewhere deep down in the server's file structure, below where I even have authorized access. So if I specify a file like so: $imageFile = $_SERVER['DOCUMENT_ROOT'] . /images/image.jpg; ... PHP gets lost and doesn't locate it. What I am looking for is a variable which will specify the base directory that my web site is rooted in. In other words, starting from the same directory that my index.html file is in. The Question: How do I specify the directory that my web site is situated in, the same directory where my main index.html file is? Is there a different variable I should be using, or perhaps some configuration of $_SERVER['DOCUMENT_ROOT'] that needs to be applied? What I've Tried So Far: First I went to the on line PHP manual, which is where I found out about $_SERVER['DOCUMENT_ROOT'] in the first place. Of all the server variables available, 'DOCUMENT_ROOT' seems to describe what I'm looking for, but doesn't behave how I would expect. A Google search was equally ineffective in educating me in what basic concept I am missing. Any advice would be much appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Confused about usage of $_SERVER['DOCUMENT_ROOT']
On Sunday 20 February 2005 12:15 pm, Dave wrote: PHP General, The Situation: I would like to be able to specify locations of scripts and files relative to the root directory from which my web site is served. I thought this was what $_SERVER['DOCUMENT_ROOT'] was for. The Problem: When I use $_SERVER['DOCUMENT_ROOT'], it creates a path starting from somewhere deep down in the server's file structure, below where I even have authorized access. So if I specify a file like so: $imageFile = $_SERVER['DOCUMENT_ROOT'] . /images/image.jpg; ... PHP gets lost and doesn't locate it. What I am looking for is a variable which will specify the base directory that my web site is rooted in. In other words, starting from the same directory that my index.html file is in. The Question: How do I specify the directory that my web site is situated in, the same directory where my main index.html file is? Is there a different variable I should be using, or perhaps some configuration of $_SERVER['DOCUMENT_ROOT'] that needs to be applied? What I've Tried So Far: First I went to the on line PHP manual, which is where I found out about $_SERVER['DOCUMENT_ROOT'] in the first place. Of all the server variables available, 'DOCUMENT_ROOT' seems to describe what I'm looking for, but doesn't behave how I would expect. A Google search was equally ineffective in educating me in what basic concept I am missing. Any advice would be much appreciated. -- Dave Gutteridge [EMAIL PROTECTED] Hi Dave, Perhaps what you should do to set $imageFile = /images/image.jpg since I would assume, whatever your Document_Root is, 'images' is a sub-directory to it. I.e.: if your servable document directory is something like /vhome/tokyocomedy/all_your_files_are_here then /vhome/tokyocomedy/all_your_files_are_here/images/image.jpg is where your image.jpg file is. Also, check using ?php phpinfo(); ? where the $_SERVER['DOCUMENT_ROOT'] is (under 'PHP Variables' section) and note where tempfiles are uploaded to as well, if you're uploading. HTh, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Confused about usage of $_SERVER['DOCUMENT_ROOT']
Andre, Mirco, BDT, Thank you for your responses. Here is some test code ?php echo img src=\inline/topimage.jpg\ ; echo img src=\/inline/topimage.jpg\ ; echo img src=\ . $_SERVER['DOCUMENT_ROOT'] . /inline/topimage.jpg\ ; ?: Theoretically, they should all output the same image. However: img src=inline/topimage.jpg -IMAGE DISPLAYS img src=/inline/topimage.jpg -IMAGE DISPLAYS img src=/home/sites/sitexxx/web/inline/topimage.jpg IMAGE DOES NOT DISPLAY Of course, the first instance only works if the script is in the correct place relative to the /inline directory. However, the second case fails if I use it in the following function (assuming I specify $dir as /inline). It returns a false result, as if it couldn't find the directory. function random_img($dir,$type='random') { global $errors,$seed; if (is_dir($dir)) { $fd = opendir($dir); $images = array(); while (($part = @readdir($fd)) == true) { if ( eregi((gif|jpg|png|jpeg)$,$part) ) { $images[] = $part; } } // adding this in case you want to return the image array if ($type == 'all') return $images; if ($seed !== true) { mt_srand ((double) microtime() * 100); $seed = true; } $key = mt_rand (0,sizeof($images)-1); return $dir . $images[$key]; } else { $errors[] = $dir.' is not a directory'; return false; } } -- Dave Gutteridge [EMAIL PROTECTED]/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Confused about usage of $_SERVER['DOCUMENT_ROOT']
Dave wrote: Here is some test code ?php echo img src=\inline/topimage.jpg\ ; echo img src=\/inline/topimage.jpg\ ; echo img src=\ . $_SERVER['DOCUMENT_ROOT'] . /inline/topimage.jpg\ ; ?: Theoretically, they should all output the same image. However: img src=inline/topimage.jpg -IMAGE DISPLAYS img src=/inline/topimage.jpg -IMAGE DISPLAYS img src=/home/sites/sitexxx/web/inline/topimage.jpg IMAGE DOES NOT DISPLAY This is the expected result. $_SERVER['DOCUMENT_ROOT'] is just that. The path from root of the _filesystem_ to where Apache's document root is. This is not Apache's document root. What you're looking for above is something like $_SERVER['HTTP_HOST'] or $_SERVER['SERVER_NAME']. I'd stick with HTTP_HOST, something like this... echo ( img src=\http://; . $_SERVER['HTTP_HOST'] . /path/to/image.jpg\; Of course, the first instance only works if the script is in the correct place relative to the /inline directory. However, the second case fails if I use it in the following function (assuming I specify $dir as /inline). It returns a false result, as if it couldn't find the directory. This is where you would want to use DOCUMET_ROOT. -- By-Tor.com ...it's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Confused about usage of $_SERVER['DOCUMENT_ROOT']
Okay, for that last possibility, the one that you used the document root variable. You have to add your domain name before, the reason being is because it's relative to where the script is, if you add the domain name (http://www.whatever.org/document/root) then it switches from relative to absolute. Dave wrote: Andre, Mirco, BDT, Thank you for your responses. Here is some test code ?php echo img src=\inline/topimage.jpg\ ; echo img src=\/inline/topimage.jpg\ ; echo img src=\ . $_SERVER['DOCUMENT_ROOT'] . /inline/topimage.jpg\ ; ?: Theoretically, they should all output the same image. However: img src=inline/topimage.jpg -IMAGE DISPLAYS img src=/inline/topimage.jpg -IMAGE DISPLAYS img src=/home/sites/sitexxx/web/inline/topimage.jpg IMAGE DOES NOT DISPLAY Of course, the first instance only works if the script is in the correct place relative to the /inline directory. However, the second case fails if I use it in the following function (assuming I specify $dir as /inline). It returns a false result, as if it couldn't find the directory. function random_img($dir,$type='random') { global $errors,$seed; if (is_dir($dir)) { $fd = opendir($dir); $images = array(); while (($part = @readdir($fd)) == true) { if ( eregi((gif|jpg|png|jpeg)$,$part) ) { $images[] = $part; } } // adding this in case you want to return the image array if ($type == 'all') return $images; if ($seed !== true) { mt_srand ((double) microtime() * 100); $seed = true; } $key = mt_rand (0,sizeof($images)-1); return $dir . $images[$key]; } else { $errors[] = $dir.' is not a directory'; return false; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [NEWBIE] Cant get $_POST to work
I have this simple form file: html head /head body form action=test.php method=post Name: input type=text name=name value=your name /br/ Age: input type=text name=age value=your age /br/ input type=submit name=submit value=submit / /form /body /html Which passes (I wish!) data to this script: ?php $name = $_POST['name'] ; $age = $_POST['age'] ; print(Hello, $name! You are $age years old!); ? It does not work unless I turn register_globals ON in the php.ini file. The php documentation leads me to believe this script SHOULD work with register_globals OFF. This a NEW instasllation of the Windows IIS Server also. Is there perhaps some configuration on the WINDOWS SERVER that must be set for general global data to be passed from a 'form' type page? David F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Handling of partially completed forms
Does anyone have any suggestions, info or references on php script/code that would enable partially completed multiple page forms that can be saved, retrieved and completed at a later date. I might add also enabling/disabling or other navigational features? I think there are are some java ones around but prefer php. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Cant get $_POST to work
David Freedman wrote: I have this simple form file: html head /head body form action=test.php method=post Name: input type=text name=name value=your name /br/ Age: input type=text name=age value=your age /br/ input type=submit name=submit value=submit / /form /body /html Which passes (I wish!) data to this script: ?php $name = $_POST['name'] ; $age = $_POST['age'] ; print(Hello, $name! You are $age years old!); ? What's the output if you put this on test.php... pre ?php print_r ( $_POST ); ? /pre -- By-Tor.com ...it's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Cant get $_POST to work
What's up David... This script *should* work... I don't see any errors, but try this anyways. In your change your print command to this: print(Hello, . $name . ! You are . $age . years old!); What those periods do is simply append them to each other, so in this case, you have the string, then you're appending the variable, then appending another string, then another variable, then the last string. Instead of having it all bunched up. David Freedman wrote: I have this simple form file: html head /head body form action=test.php method=post Name: input type=text name=name value=your name /br/ Age: input type=text name=age value=your age /br/ input type=submit name=submit value=submit / /form /body /html Which passes (I wish!) data to this script: ?php $name = $_POST['name'] ; $age = $_POST['age'] ; print(Hello, $name! You are $age years old!); ? It does not work unless I turn register_globals ON in the php.ini file. The php documentation leads me to believe this script SHOULD work with register_globals OFF. This a NEW instasllation of the Windows IIS Server also. Is there perhaps some configuration on the WINDOWS SERVER that must be set for general global data to be passed from a 'form' type page? David F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Handling of partially completed forms
Are you looking to code it yourself? If so, Here's the theory behind the concept... So you have this multiple page form that you want to save and continue at a later time correct? So you'll have to set up a save button. You will also require some way to recognize the same user when the come back (ex. a login system). So, when they half finish a form, and select the save button, you can send them to ex. save.php which will take all the user data, and store it in a mysql database, somehow tied the user (ex. a user id). When the user comes back and logs in, you can extract this form data from the database, display the form and use the form's value= field to automatically fill in the data. Joseph E. Maxwell wrote: Does anyone have any suggestions, info or references on php script/code that would enable partially completed multiple page forms that can be saved, retrieved and completed at a later date. I might add also enabling/disabling or other navigational features? I think there are are some java ones around but prefer php. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] undefined ap_block_alarms in libphp5.so in spite of SHARED_CORE
Hi - I'm trying to get PHP5 to run with Apache 2.0.5 on FreeBSD 5.3. However, I keep getting the following: Cannot load /usr/local/libexec/apache2/libphp5.so into server: /usr/local/libexec/apache2/libphp5.so: Undefined symbol ap_block_alarms Googling for this error brought lot's of results, all pointing to the manual and saying to recompile with --enable-rule=SHARED_CORE. I did so, yet the error persists. Reinstalling has no effect, and I've found nothing in the manual. Has anyone any idea how to corect this? Thanks for taking the time to help Gene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [NEWBIE] Cant get $_POST to work
Thanks for the input. However it does no good if the variables are empty, which is my problem. The darn $_POST thing does not work at all for me, and I am trying to find out why. -Original Message- From: b1nary Developement Team [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 3:40 PM To: David Freedman; php Subject: Re: [PHP] [NEWBIE] Cant get $_POST to work What's up David... This script *should* work... I don't see any errors, but try this anyways. In your change your print command to this: print(Hello, . $name . ! You are . $age . years old!); What those periods do is simply append them to each other, so in this case, you have the string, then you're appending the variable, then appending another string, then another variable, then the last string. Instead of having it all bunched up. David Freedman wrote: I have this simple form file: html head /head body form action=test.php method=post Name: input type=text name=name value=your name /br/ Age: input type=text name=age value=your age /br/ input type=submit name=submit value=submit / /form /body /html Which passes (I wish!) data to this script: ?php $name = $_POST['name'] ; $age = $_POST['age'] ; print(Hello, $name! You are $age years old!); ? It does not work unless I turn register_globals ON in the php.ini file. The php documentation leads me to believe this script SHOULD work with register_globals OFF. This a NEW instasllation of the Windows IIS Server also. Is there perhaps some configuration on the WINDOWS SERVER that must be set for general global data to be passed from a 'form' type page? David F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Cant get $_POST to work
Well this form *is* sending the data because there are no errors in your code... Their has to be some minor little mistake somewhere that we can't see in the code you gave us... look for typos, make sure the php code *is* on test.php. Also, when getting the variables from the post, try using $_REQUEST instead of $_POST, it may work. Try switching the method on the form page to get and see of they show up in the URL. You just gotta do some testing and rule out errors until you can pinpoint it. eatc7402 wrote: Thanks for the input. However it does no good if the variables are empty, which is my problem. The darn $_POST thing does not work at all for me, and I am trying to find out why. -Original Message- From: b1nary Developement Team [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 3:40 PM To: David Freedman; php Subject: Re: [PHP] [NEWBIE] Cant get $_POST to work What's up David... This script *should* work... I don't see any errors, but try this anyways. In your change your print command to this: print(Hello, . $name . ! You are . $age . years old!); What those periods do is simply append them to each other, so in this case, you have the string, then you're appending the variable, then appending another string, then another variable, then the last string. Instead of having it all bunched up. David Freedman wrote: I have this simple form file: html head /head body form action=test.php method=post Name: input type=text name=name value=your name /br/ Age: input type=text name=age value=your age /br/ input type=submit name=submit value=submit / /form /body /html Which passes (I wish!) data to this script: ?php $name = $_POST['name'] ; $age = $_POST['age'] ; print(Hello, $name! You are $age years old!); ? It does not work unless I turn register_globals ON in the php.ini file. The php documentation leads me to believe this script SHOULD work with register_globals OFF. This a NEW instasllation of the Windows IIS Server also. Is there perhaps some configuration on the WINDOWS SERVER that must be set for general global data to be passed from a 'form' type page? David F.
Re: [PHP] [NEWBIE] Cant get $_POST to work
On Sunday 20 February 2005 05:07 pm, b1nary Developement Team wrote: Well this form *is* sending the data because there are no errors in your code... Their has to be some minor little mistake somewhere that we can't see in the code you gave us... look for typos, make sure the php code *is* on test.php. Also, when getting the variables from the post, try using $_REQUEST instead of $_POST, it may work. Try switching the method on the form page to get and see of they show up in the URL. You just gotta do some testing and rule out errors until you can pinpoint it. eatc7402 wrote: Thanks for the input. However it does no good if the variables are empty, which is my problem. The darn $_POST thing does not work at all for me, and I am trying to find out why. -Original Message- From: b1nary Developement Team [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 3:40 PM To: David Freedman; php Subject: Re: [PHP] [NEWBIE] Cant get $_POST to work What's up David... This script *should* work... I don't see any errors, but try this anyways. In your change your print command to this: print(Hello, . $name . ! You are . $age . years old!); What those periods do is simply append them to each other, so in this case, you have the string, then you're appending the variable, then appending another string, then another variable, then the last string. Instead of having it all bunched up. David Freedman wrote: I have this simple form file: html head /head body form action=test.php method=post Name: input type=text name=name value=your name /br/ Age: input type=text name=age value=your age /br/ input type=submit name=submit value=submit / /form /body /html Which passes (I wish!) data to this script: ?php $name = $_POST['name'] ; $age = $_POST['age'] ; print(Hello, $name! You are $age years old!); ? It does not work unless I turn register_globals ON in the php.ini file. The php documentation leads me to believe this script SHOULD work with register_globals OFF. This a NEW instasllation of the Windows IIS Server also. Is there perhaps some configuration on the WINDOWS SERVER that must be set for general global data to be passed from a 'form' type page? David F. Hi David, I had the same problem before -- do you have a /form tag in there? Just an idea, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Cant get $_POST to work
dbfreedman wrote: I am so new I don't know what you mean by 'test.php David Please reply to the list...better chance of finding the answer to your problem that way. You have the action of your form set to 'test.php', i.e. you should have a file in the same directory as your form called test.php. In that file, put this... pre ?php print_r ( $_POST ); ? /pre If you get the values that you submitted (with globals off, like it _should_ work), then all is fine. You can also change $_POST to $_REQUEST if you wish, just to see all the data being passed to your script. -- By-Tor.com ...it's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Cant get $_POST to work
try $HTTP_POST_VARS maybe it is an older version of PHP Randy eatc7402 wrote: Thanks for the input. However it does no good if the variables are empty, which is my problem. The darn $_POST thing does not work at all for me, and I am trying to find out why. -Original Message- From: b1nary Developement Team [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 3:40 PM To: David Freedman; php Subject: Re: [PHP] [NEWBIE] Cant get $_POST to work What's up David... This script *should* work... I don't see any errors, but try this anyways. In your change your print command to this: print(Hello, . $name . ! You are . $age . years old!); What those periods do is simply append them to each other, so in this case, you have the string, then you're appending the variable, then appending another string, then another variable, then the last string. Instead of having it all bunched up. David Freedman wrote: I have this simple form file: html head /head body form action=test.php method=post Name: input type=text name=name value=your name /br/ Age: input type=text name=age value=your age /br/ input type=submit name=submit value=submit / /form /body /html Which passes (I wish!) data to this script: ?php $name = $_POST['name'] ; $age = $_POST['age'] ; print(Hello, $name! You are $age years old!); ? It does not work unless I turn register_globals ON in the php.ini file. The php documentation leads me to believe this script SHOULD work with register_globals OFF. This a NEW instasllation of the Windows IIS Server also. Is there perhaps some configuration on the WINDOWS SERVER that must be set for general global data to be passed from a 'form' type page? David F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Cant get $_POST to work
i think you have to use the ID parameter in the input tag in your HTML Name: input type=text name=name value=your name id=name /br/ Age: input type=text name=age value=your age id=age /br/ try that and see how it goes On Sun, 20 Feb 2005 17:52:26 -0500, Randy Johnson [EMAIL PROTECTED] wrote: try $HTTP_POST_VARS maybe it is an older version of PHP Randy eatc7402 wrote: Thanks for the input. However it does no good if the variables are empty, which is my problem. The darn $_POST thing does not work at all for me, and I am trying to find out why. -Original Message- From: b1nary Developement Team [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 3:40 PM To: David Freedman; php Subject: Re: [PHP] [NEWBIE] Cant get $_POST to work What's up David... This script *should* work... I don't see any errors, but try this anyways. In your change your print command to this: print(Hello, . $name . ! You are . $age . years old!); What those periods do is simply append them to each other, so in this case, you have the string, then you're appending the variable, then appending another string, then another variable, then the last string. Instead of having it all bunched up. David Freedman wrote: I have this simple form file: html head /head body form action=test.php method=post Name: input type=text name=name value=your name /br/ Age: input type=text name=age value=your age /br/ input type=submit name=submit value=submit / /form /body /html Which passes (I wish!) data to this script: ?php $name = $_POST['name'] ; $age = $_POST['age'] ; print(Hello, $name! You are $age years old!); ? It does not work unless I turn register_globals ON in the php.ini file. The php documentation leads me to believe this script SHOULD work with register_globals OFF. This a NEW instasllation of the Windows IIS Server also. Is there perhaps some configuration on the WINDOWS SERVER that must be set for general global data to be passed from a 'form' type page? David F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- The Disguised Jedi [EMAIL PROTECTED] Now you have my $0.02. Or .01 Pounds, .014 Euros, or $0.025 CAN. I'm already internationally compatible! PHP rocks! Knowledge is Power. Power Corrupts. Go to school, become evil Disclaimer: Any disclaimer attached to this message may be ignored. However, I must say that the ENTIRE contents of this message are subject to other's criticism, corrections, and speculations. This message is Certified Virus Free -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Cant get $_POST to work
Why do you need the ID? I never use that in my forms. Randy The Disguised Jedi wrote: i think you have to use the ID parameter in the input tag in your HTML Name: input type=text name=name value=your name id=name /br/ Age: input type=text name=age value=your age id=age /br/ try that and see how it goes On Sun, 20 Feb 2005 17:52:26 -0500, Randy Johnson [EMAIL PROTECTED] wrote: try $HTTP_POST_VARS maybe it is an older version of PHP Randy eatc7402 wrote: Thanks for the input. However it does no good if the variables are empty, which is my problem. The darn $_POST thing does not work at all for me, and I am trying to find out why. -Original Message- From: b1nary Developement Team [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 3:40 PM To: David Freedman; php Subject: Re: [PHP] [NEWBIE] Cant get $_POST to work What's up David... This script *should* work... I don't see any errors, but try this anyways. In your change your print command to this: print(Hello, . $name . ! You are . $age . years old!); What those periods do is simply append them to each other, so in this case, you have the string, then you're appending the variable, then appending another string, then another variable, then the last string. Instead of having it all bunched up. David Freedman wrote: I have this simple form file: html head /head body form action=test.php method=post Name: input type=text name=name value=your name /br/ Age: input type=text name=age value=your age /br/ input type=submit name=submit value=submit / /form /body /html Which passes (I wish!) data to this script: ?php $name = $_POST['name'] ; $age = $_POST['age'] ; print(Hello, $name! You are $age years old!); ? It does not work unless I turn register_globals ON in the php.ini file. The php documentation leads me to believe this script SHOULD work with register_globals OFF. This a NEW instasllation of the Windows IIS Server also. Is there perhaps some configuration on the WINDOWS SERVER that must be set for general global data to be passed from a 'form' type page? David F. -- 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] [NEWBIE] Cant get $_POST to work
That's it right there... Damn, why didn't I think of that. Hey David, what version of php are you running? Randy Johnson wrote: try $HTTP_POST_VARS maybe it is an older version of PHP Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Extension Arrays
If I have a function that creates an array using add_assoc_string and then adds it to the return value as add_property_zval, then how do I iterate over the array and get the key and its value? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Cant get $_POST to work
The Disguised Jedi wrote: i think you have to use the ID parameter in the input tag in your HTML Name: input type=text name=name value=your name id=name /br/ Age: input type=text name=age value=your age id=age /br/ try that and see how it goes If I'm not mistaken, ID in a form element will assign it a 'style', much the same way as 'class' does. It's been a while since I've done any HTML/CSS, so I could be wrong. -- By-Tor.com ...it's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Cant get $_POST to work
Randy Johnson wrote: try $HTTP_POST_VARS maybe it is an older version of PHP Randy Good catch. -- By-Tor.com ...it's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [NEWBIE] Cant get $_POST to work
Well, I guess I was wrong...I looked it up and that is correct...I couldn't remember which was the one that was needed to get the params in the right spot. -- The Disguised Jedi [EMAIL PROTECTED] Now you have my $0.02. Or .01 Pounds, .014 Euros, or $0.025 CAN. I'm already internationally compatible! PHP rocks! Knowledge is Power. Power Corrupts. Go to school, become evil Disclaimer: Any disclaimer attached to this message may be ignored. However, I must say that the ENTIRE contents of this message are subject to other's criticism, corrections, and speculations. This message is Certified Virus Free -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is there a way I can read full path names of files on the server and enter it into the database ?
Hello, I wanted to ask whether there is a way whereby a script can read filenames from a particular directory on the server and enter those filenames with the complete path into the MySQL database? I am trying to do this, because I am developing an application where a supervisor will be distributing files to different users, and those users are to work on the files allocated to them by the supervisor. There is a big pool of files containing around 10k-15k files and the supervisor will be instructed to allocate around 200 files to a user each day, and the user should be able to open that file and work on it. I am using a Linux Fedora core 2 server running Apache 2.0.53 and PHP 5.0.3 and MySQL, and my clients are Windows clients. So I wanted to ask all of you people what would be a better approach to do this, the following are the 2 options : (1)As soon as the supervisor selects say around 200 files for a user called robert, 200 files from the file pool automatically get copied to the home directory of robert. While they are copied to the home directory of Robert, the name of each file with their complete path name gets logged onto the database. Now I am doing since because I need to know where each file went and what user is working on what file. Now since robert is working on a client running on windows, we can map a drive of windows onto the home directory of robert. In this scenario can we instruct PHP to open files from a local directory (i.e. the mapped directory of windows)? Because I need to, somehow, log when a user opened the file and when he closed it. (2) The second scenario is that, I just enter the name of the files allocated to a user alongwith the complete pathnames to a database and I have another column this time where I store the user's name. Now whenever the user logs into our system using his username and password, and checks to see his work, he sees a list of files on the browser itself, but now we will have to convert this list of files into links so that the user can click on the links and directly open the file in the required software from the server itself. The issue, again, in this kind of design is that how do i open the file in the required software and even if i do it then how do i record when the user opened the file and when he finished working on it. I would request all of you to please help me in this, since I am a student and in the learning phase and this is a part of my project. If you have any doubts about whatever I have written here please write to me. I would be really grateful if you all could help me in this endeavour. Thanks in advance Vaibhav -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Extension Arrays
Chris, I have a feeling I'm missing something but from what I'm gathering you want to be able to use the key of the array right along with the value. If that's what you need then the following should work: $array = my_array_creating_function(); while(list($key, $val) = each($array)){ echo br / . $val . is the value of . $key; } Hope this was of some help! Chris Cranford wrote: If I have a function that creates an array using add_assoc_string and then adds it to the return value as add_property_zval, then how do I iterate over the array and get the key and its value? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undefined ap_block_alarms in libphp5.so in spite of SHARED_CORE
Gene. I ran into a similar problem a long time ago and found that my issue was that I had foolishly tried to recompile php5 into the same paths without cleaning out the old php binaries. I don't know if this is what you are doing but if it is then as a thought you might want to make sure that all traces of the earlier version of php has been wiped off of your system. In my case I think what was happening was I wasn't rebuilding all of the binaries and libraries from scratch, so I had a broken php4/ php5 hybrid without realizing it. :-/ If you are upgrading but this doesn't help I would also make sure that you comment out all of the mod_php4 and/ or libphp4.so lines in httpd.conf. Hope this is of some help! Gene wrote: Hi - I'm trying to get PHP5 to run with Apache 2.0.5 on FreeBSD 5.3. However, I keep getting the following: Cannot load /usr/local/libexec/apache2/libphp5.so into server: /usr/local/libexec/apache2/libphp5.so: Undefined symbol ap_block_alarms Googling for this error brought lot's of results, all pointing to the manual and saying to recompile with --enable-rule=SHARED_CORE. I did so, yet the error persists. Reinstalling has no effect, and I've found nothing in the manual. Has anyone any idea how to corect this? Thanks for taking the time to help Gene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Samba wrapper
Greetings, I am toying around with the idea of building a very basic script to do a _VERY_ basic index of the network shares at work. Almost all of them are Samba shares but I didn't see any easy way to access them without mounting them all to my servers local file system at some point or another _OR_ by using the packages that come in the samba suite (e.g. smbfind, smbtree, etc). I was wondering if anyone knew of a samba stream wrapper out there or if anyone has been working on one. I'm not even sure this is a practical solution since I don't know a tremendous amount of information about samba its self, but I would like to be able to access them as such: $res = fopen(smb://username:[EMAIL PROTECTED]/myserver/myshare/); or at least something similar to that. For a more detailed idea of what I'm talking about please see www.php.net/stream_wrapper_register and thanks for any help or direction you can send me! -Joe Wollard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php