How is this possible?
| From: | tedd | Date: | Wed, 28 Oct 2009 17:27:49 +0000 |
| Subject: | How is this possible? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-299445@lists.php.net to get a copy of this message | ||
Hi gang:
I am reviewing some old code (circa 2003) where the programmer had one script call another and placed variable values in the URL, like so:
<a href="user_edit.php?user_id=5223&action=edit">That seems innocent enough. However, in the called script (i.e., "user_edit.php") there are no:
$user_id = $_GET['user_id'];
$action = $_GET['action'];
statements to populate the variables, yet the variables get populated with the values sent!?!
How did he do that?
Incidentally, he did have in the .htaccess file the statement:
php_flag register_globals 1
So I figure that Globals have something to do with it, but I never use Globals. And if I print_r $GLOBALS, I find that user_id and action are listed (many times), but I don't see how that works.
Furthermore, something got changed and the entire script no longer works. So I'm in a quandary to figure this out -- any ideas, suggestions, references?
Thanks,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com