PHP Get Form Method Summary _php Tutorial

Source: Internet
Author: User
When PHP accepts information submitted through an HTML form, it saves the submitted data in a global array, and we can call the system-specific array of automatic global variables to get those values. The usual automatic global variables are as follows:
$_get
$_post
$_request

In getting form data, the most common automatic global variables are $_get and $_post, which obtain data submitted through the Get method and submitted via the POST method, respectively. For example, a text box form control called "Txtage", if submitted with the Get method, can be used
$_get["Txtage"] or $_get[' txtage ']
Gets the value it commits.

The $_request automatic global variable contains all get, POST, cookie, and file data, such as not concerned with the data source, can be used

$_request["Txtage"] or $_request[' txtage '] to get the submitted data.


Here's a simple example of getting the commit data:

 Echo ("Your name is:". $_post[' yourname '); Output name Echo ("
Echo ("Your password is:".)   $_post[' passwd '); The output password echo ("
Echo ("Your query password question is:".)   $_post[' question '); Query password question echo ("
Echo ("Your query password answer is:".)   $_post[' Question2 '); Query password answer echo ("
Echo ("Your date of birth is:".) $_post[' Byear ']. " Years. " $_post[' Bmonth '. "Month". $_post[' Bday '.   "Day"); Date of birth echo ("
Echo ("Your sex is:".)   $_post[' gender '); Gender Echo ("
Echo ("Your hobby is:
"   ); Hobby foreach ($_post[' hobby ') as $hobby) {echo ($hobby. "
");}? > The corresponding form code is as follows:<title>User Survey Form</title>Welcome to this website, please enter the following personal information first:
Account:
Name:
Password:
Confirm Password:
Query Password question:
--Please choose--My pet's name?Who is my best friend?My favorite color?My favorite movie?My favorite movie star?My favorite song?My favorite food?My biggest hobby?
Query password Answer:
Date of birth: ". $i."  Years "; }?> ". $i."  Month "; }?> ". $i."  Day "; }?>
Gender: Man Woman
Please choose your hobby:
Dance
Tourism
Sing
Play



http://www.bkjia.com/PHPjc/820632.html www.bkjia.com true http://www.bkjia.com/PHPjc/820632.html techarticle when PHP accepts information submitted through an HTML form, it saves the submitted data in a global array, and we can call the system-specific array of automatic global variables to get these. Commonly used automatic ...

  • Related Article

    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.