Jump to content


Photo

$HTTP_POST_VARS vs $Post


  • Please log in to reply
3 replies to this topic

#1 mcloan

mcloan
  • Members
  • PipPipPip
  • Advanced Member
  • 48 posts

Posted 29 October 2006 - 06:06 PM

Can someone tell me what the difference is between $HTTP_POST_VARS and $Post?

Thank you.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 29 October 2006 - 06:09 PM

$HTTP_*_VARS are depreciated thats the only difference

You should use the new superglobals.

$HTTP_POST_VARS is  $_POST
$HTTP_GET_VARS is $_GET
$HTTP_COOKIE_VARS is $_COOKIE
etc.

As of PHP5 they are turned off. To use these older style superglobals you'll need to turn a setting called register_long_arrays on. Otherwise just use the new shorter superglobals

#3 Zane

Zane
  • Administrators
  • Advanced Member
  • 4,134 posts

Posted 29 October 2006 - 06:10 PM

HTTP POST variables: $_POST

    Note: Introduced in 4.1.0. In earlier versions, use $HTTP_POST_VARS.


btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank
 

172938.png

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 29 October 2006 - 07:05 PM

Another difference is that $_POST is a superglobal array, which means that it can be seen throughout your script. The $HTTP_POST_VARS array can only be seen at the top most level of your script and it must be declared as global it you want to use it in funcitons.

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users