There are two ways to establish a connection on the client side and server side.
One is the get method
The other is the post method
So what is the specific difference between the two?
There is a difference in display
The get method is to The string splicing can be seen behind the address bar
but cannot be seen in the post method
The size passed is different
The specific size is related to the browser, IE browser is 2k Other browsers may have different maximums, but they are also smaller.
The size of the parameters passed by the post method can be set. It was originally considered to be infinite. In Php, the size of parameters can be set in the php.ini file.
Security
The get method is relatively low-security because it is exposed to the outside, while the post method is relatively high-security
Principle of submission
The data submitted by the get method are independent.
The Post method turns all the submitted data into a whole (turns the submitted data into xml format)
Flexibility
The get method is very flexible,
The post method is not flexible. It requires the participation of a form to submit using post. It is very inconvenient.
post and get are not a request and a submission. Both can be submitted and claimed. It’s just that the two mechanisms are different from the server side in requesting data
The above is the detailed content of The difference between get and post in php. For more information, please follow other related articles on the PHP Chinese website!