note 23247 added to reserved.variables
| From: | ganon_of_evil at msn dot com | Date: | Fri, 12 Jul 2002 18:14:16 +0000 |
| Subject: | note 23247 added to reserved.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-32998@lists.php.net to get a copy of this message | ||
If register_globals is on and you can not turn it off, this code will have the same effect. Here it
is:
function check_vars($temp){
//List all the OK request variables here//
$okvar[] = "LoginCookie_username";
$okvar[] = "LoginCookie_userid";
$okvar[] = "LoginCookie_password";
$okvar[] = "submit";
/////////////////////////////////////////
if (!in_array($temp, $okvar)){
//Returns false if request var is not in the okvars array//
return FALSE;
}
return TRUE;
}
//Now check all the keys in array $_REQUEST/////////
foreach (array_keys($_REQUEST) as $temp){
if (check_vars($temp)==FALSE){
//Change the way the script ends here//
die ("There are too many request variables!");
}
}
--
http://www.php.net/manual/en/reserved.variables.php
http://master.php.net/manage/user-notes.php?action=edit+23247
http://master.php.net/manage/user-notes.php?action=delete+23247
http://master.php.net/manage/user-notes.php?action=reject+23247