Re: $_GET verses $_POST

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jason Pruim wrote:

On Apr 12, 2009, at 1:48 PM, Ron Piggott wrote:


Thanks.  I got my script updated.  Ron

There are a few other thing's that I didn't see mentioned...

The best description of when to use what, is this.. Use POST when you are submitting a form for storing info, using GET when you are retrieving from the server...

I always use post unless the situation makes post impractical.

Example - with search results, you may have more than one page of results. The only practical way I have found to have the nice numbered links to other pages of a search result sent via post is to use JavaScript. Many users (myself included) are hesitant to enable JavaScript on sites we do not trust, especially search engines, as search engines often are vulnerable to xss (usually reflected but not always).

With get in that scenario, you just create a hyperlink with the variables, no need for javascript.

But for most scenarios, if I can do it with post I really prefer to, especially since many of my forms have an ugly 32 character long post token (for csrf protection).

It's too bad that browsers don't have an option that can be set by a html parameter for hiding get values from display in the url bar, they really are ugly to look at and the user shouldn't have to see them unless they are cutting and pasting a link.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux