Home > Backend Development > PHP Tutorial > The difference between get and post in php

The difference between get and post in php

一个新手
Release: 2023-03-16 09:48:02
Original
3184 people have browsed it

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?

  1. 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

  2. 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.

  3. Security
    The get method is relatively low-security because it is exposed to the outside, while the post method is relatively high-security

  4. 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)

  5. 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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template