note 23247 deleted from reserved.variables by dams

From: Date: Sat, 27 Jul 2002 23:21:23 +0000
Subject: note 23247 deleted from reserved.variables by dams
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-33732@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!"); } }

« previous php.notes (#33732) next »