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