In PHP, there are several forms of data submission, one is the post and get method, I will give you PHP beginners in detail to use Get,post to receive form submission data instance usage, there is a need to understand the friend can refer to.
PHP $_get and $_post variables are used to obtain information from the form, such as information entered by the user
PHP4.1 (as if) later cancels the direct receive variable, and uses the $_get[' variable name '] to receive the variable passed from the link, using the $_post[' variable name '] to receive the variable submitted from the form. also have $_files[],$_server[] etc.
The following is an HTML file that contains an HTML form (HTML form) that is used primarily to allow users to enter the user's name.
| The code is as follows |
Copy Code |
|
The HTML display interface is as follows:
When you enter the name in the form text box of the HTML file, such as "Jacky", then click OK button, the mouse will jump to get.php, in get.php will show as.
The source code for get.php is as follows:
| The code is as follows |
Copy Code |
| . |
Takes the name value of the form control to get the data for the form control.
For example, "username" is the name value of the text input box for the form control.
| The code is as follows |
Copy Code |
|
Use $_get["username" to get the data for the text input box.
| The code is as follows |
Copy Code |
|
Get HTML form (HTML form) radio box (input type= "Radio") data
You can get the value of the table-only marquee by taking the name value of the form's single box.
$_post getting HTML form submission data
The following is an HTML file that contains an HTML Form that is used primarily to allow users to enter the user's name.
| The code is as follows |
Copy Code |
|
When you enter the name in the text box of this HTML Form, such as "Jacky", then the mouse click OK button, will jump to post.php, show the output is you is Jacky. The source code for post.php is as follows:
| The code is as follows |
Copy Code |
You are .
|
Takes the name value of the form control to get the data for the form control.
For example, "username" is the name value of the text input box for the form control.
| The code is as follows |
Copy Code |
|
Use $_post["username" to get the data for the text input box.
| The code is as follows |
Copy Code |
|
$_request variable
PHP $_request variable contains $_get, $_post, and $_cookie content
PHP $_request variables can be used to get form data sent through both "get" and "POST" methods.
Case
| The code is as follows |
Copy Code |
Welcome .
You is years old |
http://www.bkjia.com/PHPjc/628755.html www.bkjia.com true http://www.bkjia.com/PHPjc/628755.html techarticle in PHP, there are several forms of data submission, one is the post and get method, I will give you PHP beginners in detail to use Get,post to receive form submission data instance usage, need to know ...