Research on parameters passing in PHPform

Source: Internet
Author: User
Tags php form
Recently, I have been working on a uchome-based secondary development website, because many of the uchome redirects are controlled by the do parameter, and this mechanism is not very detailed, there is always a feeling of fog. Why? Because there are two types of form processing: GET and POST, how to pass the do parameter in both forms, in addition, it has always been a confusing issue to obtain data in the same way in the background. after several hours of experimentation, I finally understood this article.
GET form:

       
      Use GET to pass values in a form       
        

PHP for processing GET forms:

 
   

Processing result output:
The value of the parameter name is obtained as kj through $ _ GET, the value of the parameter name is obtained through $ _ POST, and the value of the parameter name is obtained as kj through $ _ REQUEST.
The value of parm is obtained through $ _ GET, the value of parm is obtained through $ _ POST, and the value of parm is obtained through $ _ REQUEST.
The hkey value is obtained as hvalue through $ _ GET. the hkey value is obtained through $ _ POST, and the hkey value is obtained as hvalue through $ _ REQUEST.
The do value of the parameter is obtained as index through $ _ GET, the do value of the parameter is obtained through $ _ POST, and the do value of the parameter is obtained as index through $ _ REQUEST.
POST form:

       
      The form uses POST to pass values.       
        

PHP for processing POST forms:

 
   

Processing result output:
The value of the parameter name is obtained through $ _ GET. The value of the parameter name is obtained as zkj through $ _ POST, and the value of the parameter name is obtained as zkj through $ _ REQUEST.
The value of parm is obtained as url-post through $ _ GET, the value of parm is obtained through $ _ POST, and the value of parm is obtained as url-post through $ _ REQUEST.
The value of the hkey is obtained through $ _ GET, and the value of the hkey is obtained as hvalue through $ _ POST. The value of the hkey is obtained as hvalue through $ _ REQUEST.
The do value of the parameter is obtained as index through $ _ GET, the do value of the parameter is obtained through $ _ POST, and the do value of the parameter is obtained as index through $ _ REQUEST.
Conclusion:
The GET form value can be obtained through _ GET, but the parameter set through the url parameter of action cannot always be obtained.
The POST form value can be obtained through _ POST, but the parameter set through the action url parameter can be obtained through _ GET
The same variable can be obtained through _ GET, but the variable setting is hidden in the GET form. in the POST form, the variable is set through the url parameter of action.

For more articles on the details of passing parameters in the PHP form, refer to the PHP Chinese website!

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.