Difference beetween GET and POST methods in PHP

GET:

  • Parameters remain in browser history because they are part of the URL
  • Can be bookmarked.
  • GET method should not be used when sending passwords or other sensitive information.
  • 7607 character maximum size.

Example:

http://www.test.com/index.htm?name1=value1&name2=value2

POST:

  • Parameters are not saved in browser history.
  • Can not be bookmarked.
  • POST method used when sending passwords or other sensitive information.
  • 8 Mb max size for the POST method.
  • It is more secure than GET because user-entered information is never visible in the URL query string or in the server logs.

Example:

http://www.test.com/index.htm

Related posts