A very common way to submit data to a web server is through HTML forms. There are two methods of submitting data through a form: the get method and the post method. The method used is determined by the value of the method attribute of the form tag. The default method is get.
Get Method
When the get method is used, data is sent to the server in name-value pairs as part of the query string. The get method is most commonly used by search pages and is useful when it is important to be able to bookmark the resulting page (i.e, the page that is returned after the form is submitted).
Post Method
When the post method is used, data is sent to the server in name-value pairs behind the scenes. The two major advantages of the post method are:
The name-value pairs are not visible in the location bar, so sensitive data such as passwords are not displayed on the screen. Files, such as images and Office documents, can be uploaded via the form.
The major disadvantage is that the resulting page cannot be bookmarked.
Sunday, February 14, 2010
Subscribe to:
Posts (Atom)