Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Mar 2008
    Posts
    103
    Thanks
    1
    Thanked 8 Times in 8 Posts

    $_POST vs. $HTTP_POST_VARS

    Recently there has been a few arguments about which is better. I always tend to use $_POST but somebody said that I should use $HTTP_POST_VARS instead. So, which one is better to use?
    I just wanna clear this up making sure i'm not compromising security of scripts a work on or anything of the sort.

    Thanks for the help,
    ~p4plus2~

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    HTTP_POST_VARS is deprecated and I think removed in PHP5 so you tell us. Read this page: http://us.php.net/reserved.variables
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Mar 2008
    Posts
    103
    Thanks
    1
    Thanked 8 Times in 8 Posts
    Yes well...that may explain a bit...still its always best to be sure.

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,122
    Thanks
    2
    Thanked 327 Times in 319 Posts
    It might be worth mentioning that the $_POST array (all the short name arrays) was introduced in PHP 4.1.0, released 10-Dec-2001. The long array names were disabled by default in PHP 5.0 and are completely eliminated in php6.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • Users who have thanked CFMaBiSmAd for this post:

    oesxyl (03-13-2008)

  • #5
    Regular Coder
    Join Date
    Mar 2008
    Posts
    103
    Thanks
    1
    Thanked 8 Times in 8 Posts
    I still find it odd they never patched $HTTP_POST_VARS for security issues, instead they just made something new doing very similar and renaming it.

    I like it now though it is shorter so I suppose it is not all bad ~_~ just odd is all

  • #6
    Regular Coder
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's likely so that people didn't use the same superglobal variables in one version, and then complain that it didn't work the same in later versions (like what's currently happening with Internet Explorer).

  • #7
    Regular Coder
    Join Date
    Mar 2008
    Posts
    103
    Thanks
    1
    Thanked 8 Times in 8 Posts
    Thank you all for the clarifications, now I can prove somebody wrong...lol... And help him fix his scripts.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •