Skip to content

Instantly share code, notes, and snippets.

@mytory
Last active November 15, 2015 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mytory/6cc09a0584893fb25fc1 to your computer and use it in GitHub Desktop.
Save mytory/6cc09a0584893fb25fc1 to your computer and use it in GitHub Desktop.
<?php
// Emulate register_globals on
// source: http://php.net/manual/en/faq.misc.php#faq.misc.registerglobals
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);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment