Zend - The PHP Company




Miscellaneous

Add Code


register_globals patch  

Type: code fragment
Added by: Nimco
Entered: 02/09/2002
Last modified: 09/12/2001
Rating: - (fewer than 3 votes)
Views: 4277
This short patch will allow your scripts to continue working if register_globals is changed to off, without any further modification of your scripts.


<?

// Apply to other arrays simply by replacing the first argument of the 'foreach()' function with the array name.

 
foreach($_GET as $a=>$b){$$a=$b;} // $_GET
 
foreach($_POST as $a=>$b){$$a=$b;} // $_POST

?>


Usage Example




Rate This Script





Search



This Category All Categories