Bug #12800 Updated: QUERY_STRING disappears inside function bodies

From: Date: Thu, 16 Aug 2001 20:52:27 +0000
Subject: Bug #12800 Updated: QUERY_STRING disappears inside function bodies
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-63473@lists.php.net to get a copy of this message
ID: 12800 Updated by: rasmus Reported By: Frank.Cornelis@rug.ac.be Old Status: Open Status: Bogus Bug Type: Variables related Operating System: linux PHP Version: 4.0.6 New Comment: It is documented in the section on variable scope that you have to use the 'global' keyword to access a global variable from inside a function. Previous Comments: ------------------------------------------------------------------------ [2001-08-16 16:44:16] Frank.Cornelis@rug.ac.be In next PHP page test.php something weird happens: <html><body> <% // using asp_tags print "before call: $QUERY_STRING <br>"; function do_it () { print "inside: $QUERY_STRING <br>"; } do_it (); print "after call: $QUERY_STRING <br>"; %> Note: variables comming from register_globals also disappear inside the function. <form action="test.php" method="get"> <input type="hidden" name="name" value="value"> <input type="button" value="< go back" onClick="history.back()"> <input type="submit" value="do it"> </form> </body></html> If it is the normal behavior of PHP to make the QUERY_STRING disappear inside function bodies, then please document it in the PHP manual. If it's really a bug...that's bad. Please, let me know something asap. Frank. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12800&edit=1

« previous php.dev (#63473) next »