Php getting started with Form Creation and basic processing _ PHP Tutorial

Source: Internet
Author: User
Php getting started with Form Creation and basic processing. In order to facilitate the subsequent study of arrays, the transition section is introduced here. As for why, you will find its magic points when you actually learn arrays. In order to facilitate the subsequent study of arrays, the transition section is introduced here. As for why, you will find its magic points when you actually learn arrays.

========================================================== ======================================

Form: A form is an area that contains form elements.

A form element is an element that allows users to enter information in a form (such as text fields, drop-down lists, single quotes, and check boxes.

Use form tags (

In PHP, the most important attribute of the form tag is action, which specifies the page to which the form data will be sent. if it is null, it is submitted to the page containing the form, that is, the current page;
The second attribute is method, which specifies how to send data to the processing page. two options (get and post) indicate the HTTP method to be used.

Method selection:

The get method sends the submitted data to the receiving page through a series of (name-value) pairs appended to the URL. For example:
Http://www.example.com/script.php? Name = Homer & gender = M & age = 35

Unfortunately, the amount of data transmitted through get is limited, and it is not safe (because the data is visible ).

Generally, get is used for request information, such as specific records in the database or search results (almost always get is used for search ).

The post method is used when an action is required (for example, when updating database records or sending emails.

For these reasons, I generally use post. in case of exceptions, I will also point out.

Next, we will create a simple table. because this file does not contain the php code, we save the file as a (.html) suffix. of course, we can also use the (. php) suffix.

 Simple HTML form

The form is finished, and the final result is as follows:

========================================================== ========================================================== ============================

Bytes. ==================================...

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.