Practical use of PHP4

Source: Internet
Author: User
Form is the fastest and easiest way to increase interaction for your site. The form promises you to ask your customers if they like your products and leave comments to visitors who visit your site inadvertently, or ask beautiful girls for their e-forms, which is the fastest and easiest way to increase interaction for your site. The form allows you to ask your customers if they like your products, leave comments to visitors who visit your site inadvertently, or ask beautiful girls for their phone numbers. PHP can greatly simplify data processing based on Web form submission-as shown in our first example below:


--------------------------------------------------------------------------------
<Html>

<Head>
<Basefont face = ' '>
</Head>

<Body>

<Center>
<Form method = 'get' action = 'login. php'>
<Table cellspacing = '5' cellpadding = '5' border = '0'>

<Tr>
<Td>
<Font size = '-1'> What is your name? </Font>
</Td>
<Td align = 'left'>
<Input type = 'text' name = 'name' size = '10'>
</Td>
</Tr>


<Tr>
<Td colspan = '2' align = 'center'>
<Input type = 'submit '>
</Td>
</Tr>

</Table>
</Form>

</Center>
</Body>

</Html>
--------------------------------------------------------------------------------
The <FORM> tag is the most noteworthy for all pages.

--------------------------------------------------------------------------------
<Form method = 'get' action = 'login. php'>

...

</Form>
--------------------------------------------------------------------------------
You may already know that the <FORM> tag's ACTION property value specifies the name of the server-side script that will process the information entered in the FORM-'login. php, and the METHOD attribute is to clarify how information will be transmitted.
Now I will reveal the other half-'login. php' script file. If nothing happens, the script will receive the input name, check whether the user exists, and decide whether to accept or reject the request. Since you have not learned the conditional statements and logic processing of PHP, we are not going to explain it to you now-on the contrary, we only show you how the data submitted in the preceding form is transferred to 'login. php, and can be applied to this file.


This is 'login. php'

--------------------------------------------------------------------------------
<Html>
<Head>
<Basefont face = ' '>
</Head>

<Body>
<Center>
<Font face = ' 'size ='-1'>
I want to know if you have heard of Shakespeare, <? Echo $ name;?>.
<P>
He requested a bunch of roses named by another name, which may smell more fragrant.
<P>
What do you think?
</Font>
</Center>
</Body>

</Html>
--------------------------------------------------------------------------------
When you input data in the form, for example ("zhang san"), and submit it, you will see the following page:

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.