Now you're going to uncover the other half of the puzzle-"login.php" script file. If this is not an accident, the script will accept the name entered, check if the user exists, and decide whether to allow or deny access to the site. Since you haven't learned PHP's conditional statements and logic processing, we're not going to give you a demonstration right now-instead, we'll just show you how the data submitted in the previous table dropdowns is transmitted to "login.php" and can be used by this file.
< body>
< center>
< font face= "song Body" size= "-1" >
I wonder if you've ever heard of Shakespeare, <? Echo $name;
< p>
He asked for a bouquet of roses of another name, because the bouquet might smell more aromatic.
< p>
What do you think?
</FONT>
</center>
</body>
--------------------------------------------------------------------------------
When you enter data in a form, such as ("John"), and you submit it, you will see the following page:
--------------------------------------------------------------------------------
I want to know if you've ever heard of Shakespeare, John.
He asked for a bouquet of roses of another name, only for the bouquet that might smell more aromatic.
What do you think?
--------------------------------------------------------------------------------
You will see that whenever a form is submitted to a PHP script, the values of variables and forms in all forms are sent to the script in pairs, which can be invoked arbitrarily by the script. In the example above, when the form is submitted, the variable $name is created automatically in the script "login.php", and the value entered by the user in the form is assigned to the variable.
If you do the same thing with Perl, you need to write the Perl code very clearly to get the value of the variables in the form. by automatically creating and assigning values, PHP simplifies your code and dramatically increases development speed-form processing is one of the two reasons PHP is better than Perl.
Obviously, PHP also supports the Post method of form submission, all you need to do is to mark the value of methods as "post."
Of course, the example you just saw is very basic. To really point to a heavyweight program, you need to know how to organize conditional statements. A very basic conditional statement is a comparison statement-for example: "If you are equal to something, do it in some way"
PHP has a list of specially designed operators to facilitate use in conditional statements. Here is a list:
Assume $delta = 12 and $omega = 9
Operator
Significance
Expression mode
Results
==
Equals
$delta = = $omega
False
!=
Not equal to
$delta!= $omega
True
>
Greater than
$delta > $omega
True
<
Less than
$delta < $omega
False
>=
Greater than or equal to
$delta > = $omega
True
<=
Less than or equal to
$delta <= $omega
False
PHP4 also added a new operator, "= = =", to test whether two data values and types are the same, in the last section of this section there is a simple example.
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