One of the most useful features of PHP is its ability to actively assign variable values in the form to PHP variables. This makes form processing very quick. Therefore, if you send a form containing the input field VALUE: INPUTTYPE = TEXTNAME = "name" VALUE = "Glen
One of the most useful features of PHP is its ability to actively assign variable values in the form to PHP variables. This makes form processing very quick.
Therefore, if you send a form containing the input field value, the following is returned:
When you use PHP to process this page, the value of the $ name variable will be Glen Morris.
Therefore, you can print the value in the following way:
Echo 'Hi $ name! ';
Or test its value like this:
If ($ name = 'Glen Morris ') {echo 'Please check your email .';}
There is a good way to process basic forms with PHP. For example, we need to make a simple questionnaire survey. the request writer must fill in their names, email addresses, and reply to some of our favorite titles.
First, we split the page into two functions. Therefore, we only need to write a PHP page and use the program logic to hold the display content to the user, instead of writing two separate webpages (one for the form part, another CGI script for processing forms ).
Display form
The first function is used to display the form:
Functiondisplay_form (){
Global $ PHP_SELF;
?>
}
?>