Pages

Thursday 14 April 2016

PHP - GET & POST Methods

There are two ways to send information to the web server by the browser client:
  • The GET Method
  • The POST Method

The GET Method

The GET method sends the encoded user information appended to the page request. With a GET method, you are sending your data via the URL. While, with A POST method, data is embedded in the form object and sent directly from your browser to the server. 
  • The GET method produces a long string that appears in your server logs, in the browser's Location: box.
  • The GET method is restricted to send upto 1024 characters only.

The POST Method

The POST method transfers information via HTTP headers. The information is encoded as described in case of GET method and put into a header called QUERY_STRING.
  • The POST method does not have any restriction on data size to be sent.
  • The POST method can be used to send ASCII as well as binary data.
If the method is not specified in the html form get will be used by default. 
GET method places name value pairs as plain text in URL.
POST is secure because name value pairs are not visible in the URL

No comments:

Post a Comment