PHP form and user input

Source: Internet
Author: User
PHP form and user input signature. PHP form processing form example: & lt; html & gt; PHP form and user input

Http://taobeibei.iteye.com/blog/615431

PHP $ _ GET and $ _ POST are used to retrieve values in the form, such as user input.

PHP form processing form example:
 

The preceding HTML page contains two input boxes and a submit button. When you enter the form and click the submit button, the data in the form will be sent to the "welcome. php" file.

The "welcome. php" file is similar to the following:
Welcome

 .
You are Years old.

The output sample of the script above is similar to this:

Welcome John. You are 28 years old.

In the next chapter, we will explain PHP $ _ GET and $ _ POST.

Form verification

User input should be verified whenever possible. Client verification is faster and server load can be reduced.

However, any site with high traffic has to worry about server resources and the security of the site. If the form accesses the database, it is very necessary to use server-side verification.

A good way to verify a form on the server is to pass the form to itself, rather than jump to different pages. In this way, you can get an error message on the same form page. Users are more likely to find errors.

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.