PHPWomen Site Home » Programming » PHP Coding » need of GET when POST can handle!
need of GET when POST can handle! [message #2230] Tue, 12 August 2008 07:51 Go to next message
sree  is currently offline sree
Messages: 79
Registered: January 2007
Location: India
Junior Member

Hi pals,

What is the need of GET when POST can handle the things in secured ways?What can be a best answer for this?

They differ in:
1) how the data is transmitted
2) length of data
3) data passage to the server

Any other key points gals?


Sree

My Drupal tips & tricks
Re: need of GET when POST can handle! [message #2242 is a reply to message #2230 ] Wed, 13 August 2008 04:32 Go to previous messageGo to next message
lorna  is currently offline lorna
Messages: 414
Registered: October 2006
Location: Leeds, UK
Feeling Comfortable

Sree,

Because GET puts the variables on the URL, these pages can be bookmarked, which is really useful. As a general rule, GET should be used for fetching data, and POST for modifying it.

So, for example, if you search for something, you can bookmark your search results, or email the URL to someone. If its done via POST, you would have to go through filling in the form to get to the same page.

Hope that helps,

Lorna


Lorna Mitchell (online at http://www.lornajane.net)
Re: need of GET when POST can handle! [message #2245 is a reply to message #2230 ] Wed, 13 August 2008 06:01 Go to previous messageGo to next message
mvriel  is currently offline mvriel
Messages: 20
Registered: July 2008
Location: Hoorn, the Netherlands
Shiny and New
As an addendum:
POST is not more secure then GET. Attackers are only obstructed to send variables via the url. If they want to attack you via post, they just create a form on their own webspace and do it.
Re: need of GET when POST can handle! [message #2263 is a reply to message #2245 ] Tue, 19 August 2008 06:00 Go to previous messageGo to next message
sree  is currently offline sree
Messages: 79
Registered: January 2007
Location: India
Junior Member

Hi Lorna, MBriel,

Thanks for your replies.

Are there anymore explanations that we can give on these?

Last week I had an interview with Yahoo & this was 1 of their qsns.
I answerd it covering all these points but that person wanted me to explain something more!!!!!

So, out of curiosity I wish to know whether i missed something else in explanation?


Sree

My Drupal tips & tricks
Re: need of GET when POST can handle! [message #2335 is a reply to message #2230 ] Sun, 21 September 2008 11:14 Go to previous messageGo to next message
radiant_tech  is currently offline radiant_tech
Messages: 5
Registered: September 2008
Location: Greater Washington, DC Me...
Shiny and New
Shouldn't it also be mentioned that you should never take GET or POST variables at face value, but instead should subject them to a filtering process to reduce the likelihood of injection attacks?


Denise
Re: need of GET when POST can handle! [message #3043 is a reply to message #2335 ] Thu, 18 March 2010 07:40 Go to previous messageGo to next message
naresh  is currently offline naresh
Messages: 19
Registered: March 2010
Location: india
Shiny and New

In Get are post there is initial, head,body 3 stages is available in that when we use get req what ever u send that will be visible in url path. it is not secure in some times. when we send data thru get req the data placed in initial stage and large amount of data also we cant send.
post method what ever data will send that not visible in url and placed in body stage this will be some advantage and also large amount of data can be send through post but not in get method.
one advantage by using get method is when data is send to server the server picking the data in get method by initial stage only.
but in post the server picking up at body stage so some time is required when compare to get method.
initial stage: starting stage
head: is second stage
body:is last stage


Naresh
Re: need of GET when POST can handle! [message #3178 is a reply to message #3043 ] Sat, 10 July 2010 06:08 Go to previous message
serg  is currently offline serg
Messages: 1
Registered: July 2010
Shiny and New
While using GET method you can access all form variables with the $_GET array in PHP and while using POST you can access the variables with a help of $_POST. You can also access all variables with a help of $_REQUEST array.

While using GET method all the submitted data is displayed in the address bar. You notice that information which is displayed after “?”, according to php form tutorial, will be something like that:

http ://domain.com/script.php?name1=value1&name2=value2

It can be useful, where you want to bookmark a page with some specific query string values. However, the GET method is limited by the URL length (2083 characters in Internet Explorer according to Microsoft) and every of the input values must not override 100 chars. May be you also don't want to provide GET method because of submitting important data like passwords, etc, it will be displayed in the address bar.

The POST method has possibility of much volume data sending (usually by the server settings limited) and it may be used unless it represents benefits in comparing GET method. A lot of browser can not correctly bookmark pages which are displayed after HTTP POST method, because the submitted data is displayed in the address bar.

When you need the query string, which is get by GET method using (ineffective by it’s limits), you will try to use POST method for your forms. You can use POST method if you submit the important information which shouldn’t be displayed in the address bar.
Previous Topic:saving state of an object
Next Topic:Good editor
Goto Forum:
  


Current Time: Fri Sep 3 19:37:23 EDT 2010

Total time taken to generate the page: 0.01061 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.0.
Copyright ©2001-2006 FUD Forum Bulletin Board Software