PHP and HTML forms

Source: Internet
Author: User
Tags html form learn php

Just learn the HTML form, the data is not handed up, and later learned that the HTML is not able to make data.

When you learn PHP, you also know that PHP and HTML will not be able to make data, but also the support of the database.

Just beginning to learn is to form.html and form.php separate, and later see the book only need a form.php on the line, so specialized carefully looked at the difference between the two, afraid later forget, now write down.

The former, is to put the form of the rules or the description of the form.html inside, after filling the things, click the button,<form> the following Action property will start the event, jump into the form.php inside, perform verification blank things.

The latter, like function, think differently.

Enter form.php This form page, first with the IF statement to check whether the form has been submitted, if not to detect the integrity of the form, if not, then output an HTML-written form, after the user has written, click Submit, or Action property departure event, back to form.php this form, in accordance with the order, Check that you have submitted the form, and then detect the integrity of the form, everything OK ~ ~ ~ to identify the creation of a cookie and assign a way to identify already logged in: $loggedin =ture;

In this process, how to verify that the user has not written anything? Use the "!empty ()" Function!

As for how to verify that the data entered by the user is correct, the next step is to understand the interaction with the database.

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.