PHP Receive form submission Data instance detailed _php tutorial

Source: Internet
Author: User
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 ...

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