Turning on register_globals

We do not support turning on register_globals. As documented by the PHP developers, using register_globals is insecure and can lead to unauthorized data access. In most all situations, the following snippet below can emulate the expected behaviour.

<?php
// Emulate register_globals on

if (!ini_get('register_globals')) {
$superglobals = array($_SERVER, $_ENV, $_FILES, $_COOKIE, $_POST, $_GET);
if (isset($_SESSION)) {
array_unshift($superglobals, $_SESSION);
}

foreach ($superglobals as $superglobal) {
extract($superglobal, EXTR_SKIP);
}

ini_set('register_globals', true);
}
?>

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Changing the Time Zone

Our servers have been set up with the Time Zone as Newfoundland Dynamic Time (NDT). You can...

PHP 4 or 5 installed?

You can use the "Select PHP version" feature inside the applicable cPanel account for your...

Do you support the $HTTP_*_VARS variables

We do not guarantee that PHP scripts using theis older and insecure global variables will work...

Seeing a blank page or unusual behaviour?

If you are seeing a blank page or unusual behaviour, it is likely that there is an error in your...