group-icon
PHP Programming
Group for all things PHP, Coding Help, Problems and Solutions
108 Members
Join this group to post and comment.
DHIRAJ LOTLIKAR
DHIRAJ LOTLIKAR
Information Technology
13 Jan 2019

PHP GET or POST which method to choose?

Forms are generally used to develop flexible and dynamic web application where user can input and it is accepted. They can also be used to update existing data from the database.

The Submission type for form are GET or POST. The Get() method is used when we want to send the data to PHP script. With the help of Get() we can see that the user input is displayed in the address bar of the browser. It is restricted to send 1024 characters only. 

If the data is more private and you want to keep it as secret and don't want to be displayed in the address bar of the browser then you should use Post() method in place of Get() method. The Post()method goes through the HTTP header so the user input it is securely transmitted.

4mos ago

Form submissions should typically done via POST request. GET requests should be restricted to typical cases like 'SEARCH' where the search terms can be shared. 

For example - when we perform search via Google, Google sends a GET request to its servers for several tracking methods and that the search terms can be quickly shared. 

Shruthi Pillai
Shruthi Pillai
Information Technology
4mos ago

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.

The two most common HTTP methods are: GET and POST.

GET

It is used to request data from specified source.GET requests can be cached.Never use GET method if you have password or other sensitive information to be sent to the server. The data sent by GET method can be accessed using QUERY_STRING .It can only used to request data .

POST

POST is used to send data to a server to create/update a resource. The data sent by POST method goes through HTTP header so security depends on HTTP protocol. It has no restrictions on data length.

Manish Goyal
Manish Goyal
Computer Science
4mos ago

Get data is limited to 250 characters only, where as POST data is 8 MB by default but you can increase it by editing post_max_size variable in php.ini