I know that the use of $HTTP_GET_VARS
is deprecated but what about using $GLOBALS['HTTP_GET_VARS']
? Is that array key likely to disappear in the future?
I basically have the following all over a legacy project that I need to integrate with a CMS and I don't really want to have to update it unless strictly necessary.
function table_manager_import_vars($var) {
$vars = explode(",", $var);
foreach($vars AS $var) {
switch ($var) {
case "G":
$var = "HTTP_GET_VARS";
break;
case "P":
$var = "HTTP_POST_VARS";
break;
case "C":
$var = "HTTP_COOKIE_VARS";
break;
case "S":
$var = "HTTP_SESSION_VARS";
//session_start();
break;
case "E":
$var = "HTTP_SERVER_VARS";
break;
}
if (isset($GLOBALS[$var])) {
if (is_array($GLOBALS[$var])) {
foreach($GLOBALS[$var] AS $var1 => $value) {
if ($var1 != $var) {
$GLOBALS[$var1] = $value;
}
}
}
}
}
}
// called like this
table_manager_import_vars("G,P,C,S,E");
And yes you guessed it there is a function like this for every aspect of the project just with a different name each time!!