#18452 [Com]: Superglobals appear to not work...

From: Date: Sun, 10 Nov 2002 18:01:16 +0000
Subject: #18452 [Com]: Superglobals appear to not work...
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-24445@lists.php.net to get a copy of this message
ID: 18452 Comment by: php@pwoods.fsnet.co.uk Reported By: dilbert@hack3r.com Status: Bogus Bug Type: Variables related Operating System: OpenBSD PHP Version: 4.2.1 New Comment: try using $HTTP_GET_VARS rather than $_GET... I am new to this so I might be wrong but the $_GET and $_POST etc seem deprecated in this version. Previous Comments: ------------------------------------------------------------------------ [2002-07-22 19:54:18] dilbert@hack3r.com you just told me I was crazy ;) but okay, I fixed that problem (heh) this STILL isn't a bogus bug, however... Look at the example page i supplied above, .... echo "<br><hr>"; $h = "_GET"; print_r($$h); // Works! echo "<br><hr>"; function pr2() { $g = "_GET"; print_r($$g); } // DOESN'T WORK! pr2(); .... That part is still true. Comments and all. Now, thats the bug I was dealing with previously (before i screwed up and figured all superglobals didn't work :/) I knew I messed something up, at least I've finally got this refined... Am I missing something again, or have I finally nailed it? Ted ------------------------------------------------------------------------ [2002-07-21 14:21:57] tal@php.net Of course it doesn't work, you don't call the functions... -Tal ------------------------------------------------------------------------ [2002-07-20 22:42:44] dilbert@hack3r.com An example of this failure can be seen here: http://roothack.org/~articles/test.php?var=value (wonder how many tries this is going to take...) ------------------------------------------------------------------------ [2002-07-20 22:41:40] dilbert@hack3r.com An example of this failure can be seen here: http://roothack.org/articles/test.php?var=value (case...) ------------------------------------------------------------------------ [2002-07-20 22:39:02] dilbert@hack3r.com An example of this failure can be seen here: http://roothack.org/Articles/test.php?var=value The Source to that page is here: <? // PHP 4.2.1 // get like: file.php?name=hi // Isn't $_GET supposed to be "superglobal" ? print_r($_GET); // Works! echo "<br><hr>"; function pr1() { print_r($_GET); } // DOESN'T WORK! echo "<br><hr>"; $h = "_GET"; print_r($$h); // Works! echo "<br><hr>"; function pr2() { $g = "_GET"; print_r($$g); } // DOESN'T WORK! echo "<br><hr>"; function pr3() { global $_GET; print_r($_GET); } // DOESN'T WORK!?? ?> Information about the server can be found here: http://roothack.org/~articles/test2.php (its phpinfo();) Please tell me I'm not crazy... ;) Ted Kaminski ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18452&edit=1

« previous php.bugs (#24445) next »