Hi,
How do you turn off register_globals at run time?
I had the following code:
function unregister_globals()
{
// adapted from Jan. 2003 PHPArch magzine,
// [url]http://www.phparch.com/[/url]
// turn off register_globals at run time
$REQUEST = $_REQUEST;
$GET = $_GET;
$POST = $_POST;
$COOKIE = $_COOKIE;
// if no session is set, $_SESSION is undefined,
// this solves the undefined variable problem on some servers
if (isset($_SESSION)) {
$SESSION = $_SESSION;
}
$FILES = $_FILES;
$ENV = $_ENV;
$SERVER = $_SERVER;
foreach ($GLOBALS as $key => $value) {
if ($key != "GLOBALS") {
unset($GLOBALS[$key]);
}
}
$_REQUEST = $REQUEST;
$_GET = $GET;
$_POST = $POST;
$_COOKIE = $COOKIE;
if (isset($SESSION)) {
$_SESSION = $SESSION;
}
$_FILES = $FILES;
$_ENV = $ENV;
$_SERVER = $SERVER;
return true;
}
but it also unset all the previous defined variables! How come?
How do you turn off the register_globals at run time?
Thanks!:rolleyes: