PHP form table only son study _php tutorial

Source: Internet
Author: User
Why is it? Because the processing of the form has get and post two, how in both forms to pass always do parameters, and in the background through the same way to get it has been a very confusing problem, today after a few hours of experiment finally understand, special hair this article.
Get form:
Copy CodeThe code is as follows:
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >



<title>The form uses the Get method to pass the value</title>







PHP to handle get forms:
Copy CodeThe code is as follows:
















Processing result output:
The value of the parameter name is obtained by $_get as KJ, the value of the parameter name is obtained by $_post, and the value of the parameter name is obtained by $_request as KJ.
The value of the parameter parm is obtained by $_get as, the value of the parameter parm is obtained by $_post, and the value of the parameter parm is obtained by $_request.
The value of the parameter hkey is obtained by $_get as Hvalue, the value of the parameter hkey is obtained by $_post, and the value of the parameter hkey is obtained by $_request as Hvalue.
The value of the parameter do is obtained by $_get as index, the value of the parameter do is obtained by $_post, and the value of the parameter do is obtained by $_request as index.
POST form:
Copy CodeThe code is as follows:
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >



<title>Forms use post to pass values</title>







PHP to process the POST form:
Copy CodeThe code is as follows:
















processing result output:
The value of the parameter name is obtained by $_get as the value of the parameter name is obtained by $_post as ZKJ, and the value of the parameter name is obtained by $_request as zkj.
The value of the parameter parm is obtained by $_get as Url-post, the value of the parameter parm is obtained by $_post, and the value of the parameter parm is obtained by $_request as Url-post.
The value of the parameter hkey is obtained by $_get as the value of the parameter hkey is obtained by $_post as Hvalue, and the value of the parameter hkey is obtained by $_request as Hvalue.
The value of the parameter do is obtained by $_get as index, the value of the parameter do is obtained by $_post, and the value of the parameter do is obtained by $_request as index.
Conclusion:
Get form values can be obtained through _get, but parameters set through the action's URL parameter are always not available
The Post form value can be obtained through _post, but parameters set through the action's URL parameter can be obtained through _get
The same variable can be obtained through _get, but in the get form by hiding the variable settings, in the Post form through the action URL parameter settings

http://www.bkjia.com/PHPjc/320280.html www.bkjia.com true http://www.bkjia.com/PHPjc/320280.html techarticle for what? Because the processing of the form has get and post two, how in both forms to pass the always do parameter, and in the background through the same way to get is always a very confused ...

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