php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17936 GET variables have no value
Submitted: 2002-06-23 18:47 UTC Modified: 2002-06-23 18:56 UTC
From: strelitz at kona dot net Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.2.1 OS: windows 2000 sp2 IIS 5.0
Private report: No CVE-ID: None
 [2002-06-23 18:47 UTC] strelitz at kona dot net
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?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-23 18:50 UTC] cynic@php.net
In PHP 4.2.0, the 'register_globals' setting default changed to
be off. See http://www.php.net/release_4_2_0.php for more info.
We are sorry about the inconvenience, but this change was a necessary
part of our efforts to make PHP scripting more secure and portable.
 [2002-06-23 18:56 UTC] strelitz at kona dot net
Wow!
Thanks for your lightning-fast response!
I changed it and it worked.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 08 11:03:42 2023 UTC