October 13th, 2000, 09:34 AM
I know that with method=post, we can get clean address in the address bar which is only the file name was viewed, and the variables not viewed.
I want to know what is the benefit of using method=get, and what other benefits of using method=post.
Thank you for any reply.
October 13th, 2000, 10:01 AM
With the method get the user can change the information that's send to the server, and put information in it that isn't good.
With the method post the variables will be put in $HTTP_POST_VARS and the user can't change the variables in the address bar.
The user can't change it, and can't mess around with it
hope this is what u looked for
October 13th, 2000, 10:07 AM
The difference is not as much functional as it is conceptutal. They're both intended to be used for different purposes.
- GET implies the form is only requesting information like an html doc, an image, or maybe some information from a database.
- POST implies the form processing may update information on the server
Functional differences aren't too drastic:
- GET passes form data along with the URL. Subsequently, a form's data passing ability is limited by a browsers limit on URL length. Re-requesting the URL will pass all the data to the server again.
- POST passes form data along as input arguments to a script or program. This is not limited by the client, so much more data can be passed when using the POST method. Re-requesting the URL to which data was POST'd will not send form data to the server again, unless your browser caches that data, and prompts you to send it again (usually with a "Yes/No" dialogue box). This is just in case that data was used to alter, say, a database on the server. It's not wise to introduce redundant, or extraneous data into a database.
Note that these functionl differences depend on the browser you use. Some [older] browsers have poor implementations of the POST method.
October 13th, 2000, 10:48 AM
So why still I see so many web pages using get method, when there's no drastic functional difference?
I've ever change the variable in the URL in some web sites, and they give me an error page or even a page with not supposed to be input variable
I've run some problems though with post method when I want to assign a page link with customisable variable (<a href=""$PHP_SELF?viewCat=$CatID blah blah ...> )
Thanx for your reply anita and chris.
Is there any more comment on this?
October 13th, 2000, 12:28 PM
One benefit of the GET method is that the user can bookmark the result page. This is good for a product page that is generated from a database. You want the customer to be able to come back to the page without having to fill out another search form. Or be able to send a link to a friend.
October 13th, 2000, 01:12 PM
Silly, I never thought about it, although it supposed to be clear to me.