Home >Backend Development >PHP Tutorial >What are PHP forms and form creation
Introduce what a form is
The function of a WEB form is to provide an interactive platform between viewers and the website. WEB forms are mainly used to send data to the server in web pages. For example, forms are required when submitting registration information. When the user fills in the information, the submit operation is performed, that is, the content of the form is transferred from the client's browser to the server. After being processed by the PHP program on the server, the information required by the user is transferred back to the client's browser. superior. By obtaining various information submitted by users, PHP and WEB forms can interact.
Since we mentioned Web development, we have to mention HTML. As the standard language for Web user front-end interface design, HTML is something that developers must understand and apply skillfully, especially the form part of HTML. Particularly important.
Form and HTML markup language
HTML is a world-wide hypertext markup language. Images, links, music and programs can be realized through HTML and many other elements. Nowadays, it is a basic skill necessary for programmers.
Form is the most commonly used component in WEB field applications. It consists of submitbutton and other related components. Forms are used in many fields to implement user registration, login, online shopping, banking and other functions.
Create a form
Use the ff9c23ada1bcecdd1a0fb5d5a0f18437 tag and insert relevant form information into it to create a form. The structure of the form is as follows:
<form name= "form_name" method="method" action="url" enctype="value" target="target_win"> // 插入一些表单元素 <form>
ff9c23ada1bcecdd1a0fb5d5a0f18437 TagAttributes are as follows:
Description | |
The name of the form | |
Set the form submission method, GET or POST method | |
Point to the URL of the page that handles the form (relative path Or absolute path) | |
Set the encoding method of the form content | |
Set return The way information is displayed, the attribute value of target will be explained below. |
Description | |
Display the returned information in a new window | |
The return information will be displayed in the parent window | |
The return information will be displayed Display in the current window | |
Display the returned information in the top-level window |
The above is the detailed content of What are PHP forms and form creation. For more information, please follow other related articles on the PHP Chinese website!