PHP getting form step summary _ PHP Tutorial

Source: Internet
Author: User
PHP obtains the form step summary. PHP obtains the Form method summary. When php accepts the information submitted through the HTML form, it saves the submitted data in the global array, we can call the system-specific automatic global variable array to obtain the Form method summary in PHP.
When php accepts information submitted through an HTML form, it saves the submitted data in a global array. we can call the system-specific automatic global variable array to obtain these values. Common automatic global variables are as follows:
$ _ GET
$ _ POST
$ _ REQUEST

In getting form data, the most common automatic global variables are $ _ GET and $ _ POST, which respectively obtain the data submitted through the GET method and the data submitted through the POST method. For example, if a text box form control named "txtAge" is submitted using the GET method, you can use
$ _ GET ["txtAge"] or $ _ GET ['txtage']
Obtain the submitted value.

$ _ REQUEST the automatic global variable contains all GET, POST, COOKIE, and FILE data. if you do not care about the data source, you can use

$ _ REQUEST ["txtAge"] or $ _ REQUEST ['txtage'] to obtain submitted data.


The following is a simple example of getting submitted data:

 "); Echo (" Your name is: ". $ _ POST ['yourname']); // Output name echo ("
"); Echo (" your password is: ". $ _ POST ['passwd']); // output password echo ("
"); Echo (" Your query password problem is: ". $ _ POST ['question']); // query password problem echo ("
"); Echo (" The answer to your query password is: ". $ _ POST ['question2']); // echo ("
"); Echo (" your date of birth is :". $ _ POST ['byear ']. "Year ". $ _ POST ['bmonth']. "Month ". $ _ POST ['bday']. "Day"); // date of birth echo ("
"); Echo (" your gender is: ". $ _ POST ['gender']); // gender echo ("
"); Echo (" your hobby is:
"); // Foreach ($ _ POST ['hobby'] as $ holobby) {echo ($ holobby ."
") ;}?> The corresponding form code is as follows:User SurveyWelcome to this website. enter the following personal information:
Account:
Name:
Password:
Confirm password:
Password query:
-- Select --My pet name?Who are my best friends?My favorite colors?My favorite movies?My favorite movie stars?My favorite songs?My favorite food?My biggest hobby?
Query password answer:
Date of birth: ". $ I." year";}?> ". $ I." month";}?> ". $ I ."";}?>
Gender: Male Female
Select your hobbies:
Dancing
Tourism
Singing
Play

When php accepts information submitted through HTML forms, it saves the submitted data in the global array. we can call the system-specific automatic global variable array...

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.