Home  >  Article  >  Backend Development  >  PHP Tutorial: The difference between passing values ​​through POST and GET_PHP Tutorial

PHP Tutorial: The difference between passing values ​​through POST and GET_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 14:56:18970browse

Question:

I used POST as the method, but why not use the GET method?

First let’s take a look at the difference between POST and GET value transfer:

When Post transmits data, it does not need to be displayed in the URL, but the Get method must be displayed in the URL. The amount of data transmitted by Post is large and can reach 2M, while the Get method can only transfer about 1024 bytes due to the limitation of URL length. Generally speaking, we use POST value as the first choice, which is safer.

The difference between $_REQUEST, $_POST and $_GET in PHP

Three methods are used to receive form data

$_REQUEST has the functions of $_POST and $_GET, but $_REQUEST is slower. All data submitted through the POST and GET methods are available through the $_REQUEST array.

The differences and characteristics of $_POST and $_GET

1. GET is to obtain data from the server, and POST is to transmit data to the server.

 2. GET adds the parameter data queue to the URL pointed to by the ACTION attribute of the submitted form. The value corresponds to each field in the form one-to-one and can be seen in the URL. POST uses the HTTP POST mechanism to place each field in the form and its content in the HTML HEADER and transmit it to the URL address pointed to by the ACTION attribute. Users cannot see this process.

 3. For the GET method, the server uses Request.QueryString to obtain the value of the variable. For the POST method, the server uses Request.Form to obtain the submitted data.

4. The amount of data transmitted by GET is small and cannot be larger than 2KB. The amount of data transmitted by POST is large and is generally unrestricted by default. But in theory, the maximum amount is 80KB in IIS4 and 100KB in IIS5.

 5. GET security is very low, POST security is high.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/364222.htmlTechArticleQ: form action=search_result.php method=POST I used POST as the method, but why not use the GET method? Woolen cloth? First, let’s take a look at the difference between POST and GET value transfer: When Post transmits data, it does not...
Statement:
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