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