On Wed, 6 Nov 2002, Jason Young wrote:
> So then can anyone tell me why its working so far? ;)
It doesn't work at all like you want it to. I assume you've already put
this script up on a web server to test, so watch this:
After this line:
$$key = $val;
Insert this line for debugging:
echo $key . " --> " . $val . "<br>\n";
Then visit the script:
scriptname.php?foo=2&2=1
You've created something far worse than register globals.
Someone already posted a decent solution, something like this:
foreach( $get_allow as $get_key => $get_val ){
if( isset( $_GET[$get_val] ) ){
${$get_val} = $_GET[$get_val];
echo $get_val . " --> " . $_GET[$get_val] . "<br>\n";
}
}
g.luck,
~Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php