photoshop cs4 Chinese version download PHP4 practical application experience 2

WBOY
Release: 2016-07-29 08:34:13
Original
1025 people have browsed it

Author: Sun Movement
Now I will reveal the other half of the mystery to you - the "login.php" script file. If nothing else, this script will accept the entered name, check to see 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 are not going to demonstrate it for you now - instead, we will just show you how the data submitted in the previous form is sent to "login.php" and can used by this file.
 This is "login.php"
----------------------------------------- ---------------------------------------
< html>
< head>

Said Shakespeare, ? echo $name; ?>.
< p>
He asked for a bouquet of roses with another name because that bouquet might smell more fragrant.
< p>
What do you think?
< /font>
< /center>
< /body>
< /html>
------------------------- -------------------------------------------------- -----
 When you enter data in the form, for example ("Zhang San"), and submit it, you will see the following page:
---------------- -------------------------------------------------- ----------------
I wonder if you have heard of Shakespeare, Zhang San
He asked for a bouquet of roses with another name, just because that bouquet might smell more fragrant Some
What do you think?
------------------------------------------------- ----------------------------------
You will see that whenever the form is submitted to the PHP script, all The variable value in the form and the name of the form will be sent to the script in pairs, so that they can be called arbitrarily by the script. In the above example, when the form is submitted, the variable $name is automatically created in the script "login.php", and the value entered by the user in the form is also assigned to this variable.
 If you were to do the same thing in Perl, you would need to write the Perl code very clearly to get the variable value in the form. By automatically creating and assigning values, PHP simplifies your code and greatly improves development speed - form handling is one of the two reasons why 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 METHOD as "POST".
Of course, the example you just saw is very basic. For really heavyweight programming, you need to know how to organize conditional statements. A very basic conditional statement is a comparison statement - for example: "If X and X are equal, then do this action in a certain way"
  PHP has a series of operators specially designed to facilitate use in conditional statements. Here is a list:
Assume $delta = 12 and $omega = 9
Operator
Meaning
Expression
Result
==
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 adds a new operator "===", which is used to test whether the two data values ​​and types are the same. The last section of this section contains a simple example.

The above introduces photoshop cs4 Chinese version download PHP4 practical application experience part 2, including the content of photoshop cs4 Chinese version download, I hope it will be helpful to friends who are interested in PHP tutorials.


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template