Register Globals Afvang

From Edgar BV Wiki
Revision as of 08:53, 8 March 2007 by Red (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
//Handling: When Superglobals in php.ini disabled;
// In een bestand zetten dat geinclude wordt (bijv. db_inc.php)

if(isset($HTTP_POST_VARS)){
 while(list($var, $val)=each($_POST)){
  if (is_array($var)){
            $arraySize = count($var);$ab = 0;
            while ($ab <= $arraySize){
                        $$var[$ab] = $val[$ab];
                        $ab++;
            }
  } else {
            $$var = $val;
  }
 }
}
 
 
//Error Handling: When Superglobals in php.ini disabled;
if(isset($HTTP_GET_VARS)){
 while(list($var, $val)=each($_GET)){
  if (is_array($var)){
            $arraySize = count($var);$ab = 0;
            while ($ab <= $arraySize){
                        $$var[$ab] = $val[$ab];
                        $ab++;
            }
  } else {
            $$var = $val;
  }
 }
}