From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020722 Description of problem: I have found that the arguments passed through a URL to a php app do not reach my php code. The code for a "test.php" program is <?php echo "value of key: zzz" . $key . "xxx<br>\n"; phpinfo(); ?> When called with the URL "test.php?key=3", the output result is: value of key: zzzxxx instead of the expected: value of key: zzz3xxx The call to phpinfo() returns these: _GET["key"] 3 _SERVER["REQUEST_METHOD"] GET _SERVER["QUERY_STRING"] key=3 _SERVER["REQUEST_URI"] /test.php?key=3 _SERVER["SCRIPT_NAME"] /test.php _SERVER["PHP_SELF"] /test.php _SERVER["argv"] Array ( [0] => key=3 ) _SERVER["argc"] 1 The full output from phpinfo is included in the attached file "test.php.html". You will see that I accessed the server remotely, but I obtained the same result accessing it locally (on the same machine). Version-Release number of selected component (if applicable): # rpm -q php php-4.2.2-9 How reproducible: Always Steps to Reproduce: Simply run the program test.php?key=3 through the apache web server again. Additional info:
Created attachment 72824 [details] Output from "test.php" when run with key=3 as an argument
The attachement test.php.html shows that I direct error messages to /tmp/php.errors.txt, but when I found the bug described above, the php.errors.txt file does not show any messages.
Not a bug - since PHP 4.2.0, external parameters are not by default registered as global variables. See the Warning box on this page: http://www.php.net/manual/en/language.variables.predefined.php You should either set "register_globals = on" in /etc/php.ini, or (preferred) switch to the new superglobal arrays (eg. $_GET['key'] )
*** Bug 72752 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of 72752 ***