|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-23 18:50 UTC] cynic@php.net
[2002-06-23 18:56 UTC] strelitz at kona dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 14:00:01 2025 UTC |
Variables passed in via a GET are inexplicable undefined. I wrote a simple script to receive a variable passed in through an URL, and print it. The problem is the variable is undefined, though if I put a phpinfo() function in the script, its output correctly shows my variable and its value. Contents of "test.php" script: <html><head><title>test</title></head> <body> <?php if (empty($test)) { echo 'parameter "test" undefined';} else { echo 'parameter "test" value is "' . $test . '"' ;} phpinfo(); ?> </body> </html> URL call: http://localhost/test.php?test=hello Output is "Parameter 'test' undefined" I expected "Parameter 'test' value is 'hello'" Though the phpinfo output shows "test=hello" in the QUERYSTRING variable and "fff" in the _GET["test"] variable. Am I missing something obvious?