This article mainly introduces the implementation of PHP obtaining form data and HTML embedding PHP scripts. It has a certain reference value. Now I share it with you. Friends in need can refer to it.
PHP accepts HTML When the form submits information, the submitted data will be saved in the global array. We can call the system-specific automatic global variable array to obtain these values.
Commonly used automatic global variables are as follows:
1. GET method
Function:Get the data submitted by get method
Format:$_GET["formelement"]
2. POST method
Function:Get the data submitted by post method
Format:$_POST["formelement"]
##3. REQUEST method
Function:Get data submitted in any way. The $_REQUEST automatic global variable contains all GET, POST, COOKIE and FILE data, if you don’t care about the data source.
Format:$_REQUEST["formelement"]
Check box, list box (the name is in the form of an array For example: "select[]", just use $_POST["select"] when getting its value) Related recommendations:PHP method to get page execution time
PHP method to get the first Chinese initial letter and sort it
Detailed explanation of PHP getting memory usage
The above is the detailed content of Implementation of obtaining form data with PHP and embedding HTML into PHP scripts. For more information, please follow other related articles on the PHP Chinese website!