note 13422 added to language.variables.php
| From: | npdavis at hotmail dot com | Date: | Fri, 15 Jun 2001 21:00:52 +0000 |
| Subject: | note 13422 added to language.variables.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14320@lists.php.net to get a copy of this message | ||
Here is a slick set of loops that will fix code that is placed on a box with --enable-track-vars
turned on... keeps you from having to define all of your GPC's explicitly... However, this
could be a bad thing: ) You may need to switch the order to match the paradigm that the code was
written under...IE if your order is CGP you would need to alter it.
<?PHP
while(list($key, $val) = each($HTTP_GET_VARS)){
$gbuild = "$".$key;
$gbuild.="=";
$gbuild.=addslashes($val).";";
eval($gbuild);
}
while(list($key, $val) = each($HTTP_POST_VARS)){
$pbuild = "$".$key;
$pbuild.="=";
$pbuild.=addslashes($val).";";
eval($pbuild);
}
while(list($key, $val) = each($HTTP_COOKIE_VARS)){
$cbuild = "$".$key;
$cbuild.="=";
$cbuild.=addslashes($val).";";
eval($cbuild);
}
?>
http://www.php.net/manual/en/language.variables.php