The simple way around this is to write something that injects the variables into the project scope. This function will read all the variables from the url and inject them into the project scope. You should never rely on register_globals, but if you don't want to update old code this is an easy workaround.
function register_globals() { //if register_globals is on then return if(ini_get("register_globals")) return; //inject URL vars into scope foreach($_REQUEST as $key=>$item) { $GLOBALS[$key] = $item; } }
Very useful
ReplyDeleteI wrote a script to register globals and track down usage of them. check it out here if you want to remove the dependency entirely.
ReplyDeletehttp://www.phpclasses.org/package/8386-PHP-Log-the-usage-of-registered-global-variables.html