note 30277 deleted from reserved.variables by sniper
| From: | sniper@php.net | Date: | Tue, 21 Oct 2003 19:43:46 +0000 |
| Subject: | note 30277 deleted from reserved.variables by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59072@lists.php.net to get a copy of this message | ||
Note Submitter: LouisGreen@pljg.freeserve.co.uk
----
If you require access to Predefined Variables in different PHP versions and don't wish to mess
about with how you access them, this little snippet of code might help you:
function fn_http_vars_access() {
global $GET_VARS, $POST_VARS, $COOKIE_VARS, $SESSION_VARS, $SERVER_VARS, $ENV_VARS;
$parser_version = phpversion();
if ($parser_version <= "4.1.0") {
$GET_VARS = $GET_VARS;
$POST_VARS = $POST_VARS;
$COOKIE_VARS = $COOKIE_VARS;
$SESSION_VARS = $HTTP_SESSION_VARS;
$SERVER_VARS = $HTTP_SERVER_VARS;
$ENV_VARS = $HTTP_ENV_VARS;
}
if ($parser_version >= "4.1.0") {
$GET_VARS = $_GET;
$POST_VARS = $_POST;
$COOKIE_VARS = $_COOKIE;
$SESSION_VARS = $_SESSION;
$SERVER_VARS = $_SERVER;
$ENV_VARS = $_ENV;
}
}
fn_http_vars_access();