Skip to content

Difference between GET and POST method in PHP


What is HTTP? The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients and servers. HTTP works as a request-response protocol between a client and server.

Two HTTP Request Methods commonly used for request-response between a client and server: GET and POST. In this article we are going to understand difference between Get and Post method in php.

The GET Method : Following example which shows you how to use get method.

Following are GET Request Method Points.

  1. Request can be cached
  2. Requests can be bookmarked
  3. Requests remain in the browser history
  4. Requests have length restrictions
  5. Requests should be used only to retrieve data
  6. Requests should never be used when dealing with sensitive data
  7. Maximum path length of 2,048 characters
  8. Data visible to everyone in URL
  9. GET is less secure compared to POST because data sent is the URL.

Following are POST Request Method Points.

  1. Requests are never cached
  2. Requests do not remain in the browser history
  3. Requests cannot be bookmarked
  4. No restriction data length
  5. Requests have no restrictions on data length
  6. Data is not displayed in URL
  7. POST is a little safer than GET because the parameters are not stored in browser history.


Developer Diary writing articles for a beginner programmer to find a technical solution which we went through with our own experience. In this article we try to understand difference between Get and Post method which is very useful if you are beginner and want to start your career as a backend developer then this understanding will help you more.

If anyone to be a part of this please feel free share with us your problem with solutions. So we can share with more needed coder.

Related Articles

  1. Set session in CodeIgniter
  2. WordPress vs Joomla
  3. How to install Gulp 4 with sample project
  4. Why all sites now require SSL (https)