$_get and $_post functions in PHP. Value is not submitted to PHP file, I do not see in the Address bar php suffix name?

Source: Internet
Author: User
Keywords Php
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:
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.