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. ==================================...