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!