Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: $http_post_vars - ??
01-04-2008, 10:25 PM #1
- Join Date
- Jan 2008
- Thanked 0 Times in 0 Posts
$http_post_vars - ??
What does $HTTP_POST_VARS mean, and what does it do?
01-04-2008, 10:47 PM #2
- Join Date
- Apr 2007
- Philadelphia, PA, USA
- Thanked 258 Times in 254 Posts
It shouldn't be used anymore. It has been deprecated since 4.1.0 in favor of $_POST:
An associative array of variables passed to the current script via the HTTP POST method. Automatically global in any scope.
This is a 'superglobal', or automatic global, variable. This simply means that it is available in all scopes throughout a script. You don't need to do a global $_POST; to access it within functions or methods, as you do with $HTTP_POST_VARS.
$HTTP_POST_VARS contains the same initial information, but is not a superglobal. (Note that $HTTP_POST_VARS and $_POST are different variables and that PHP handles them as such)
If the register_globals directive is set, then these variables will also be made available in the global scope of the script; i.e., separate from the $_POST and $HTTP_POST_VARS arrays. For related information, see the security chapter titled Using Register Globals. These individual globals are not superglobals.