Php
Reply content:
$_get, $_post function is in the PHP program from Get or POST request to get the value, where GET request can see the value in the Address bar, and the POST request will be in the Entity-body (message body) value, the address bar is not visible (can be obtained by grabbing packets, So do not feel that the post value is more secure than the get pass value.
I wrote a small program that demonstrates the similarities and differences between get and post values. In the first line of input box input, click "Test Get" to make a GET request to the server and send a value, and the server will return the confirmation information, the same, in the second line input box input, click "Test Post" to issue a POST request and pass the value, you will also see the confirmation information returned.
The page that you see in the browser is as follows:
HTML code: HTML code:
"Server confirms receipt of a GET request for value"
In the address bar you can clearly see the value=rabbit, below also has the confirmation receives the value the message.
Then look at the HTTP data Baobaoven content of Get request, the value that needs to be passed "rabbit" is in the request URL, as parameter value (that is, you see in the Address bar).
"Server confirms receipt of POST request value"
Unlike the get value above, the POST request value is not reflected in the address bar (so many people intuitively feel that post is worth more than get security).
then look at the message content of the POST request. By directly reading the packet content, you can see the request URL does not contain any value of the content, which is why you do not see in the Address bar, and in the message body below, it is clear that value:rabbit can be seen. Then look at the message content of the POST request. By directly reading the packet content, you can see the request URL does not contain any value of the content, which is why you do not see in the Address bar, and in the message body below, it is clear that value:rabbit can be seen.
Although the two kinds of methods vary greatly, but for the PHP program to read the value of the same way, that is, through the $_get, $_post function directly read.
"Attached" test program code: