Php development form
Form
Web forms provide a platform for interactions between visitors and websites. Web forms are mainly used to send data to servers on webpages.
(1) create a form
You can create a form by using the form element and inserting the relevant form element in it. The form structure is as follows:
The attributes marked by form are shown in the following table:
The attribute values of target are shown in the following table:
Note:
The GET method is to append the form content to the URL address and send the form content as a data block to the processing program on the server, the form information is not displayed in the New Zealand browser. the default method is GET.
(2) form elements
Common form elements include the following tags: input field tags <Input>, Select the domain tag <Select> And <Option>, Text field mark <Textarea>
A) input tag field <Input>
The syntax format is as follows:
Parameter name refers to the name of the input field, and parameter type refers to the type of the input field. The type is determined by the type. The type list is as follows:
B) <Select> And <Option>
Mark by selecting a domain <Select> And <Option> You can create a list or menu. The menu is used to save space. Normally, only one option can be seen. you can click the lower triangle button on the right to open the menu to see all options. A certain number of options can be displayed in the list. if this number is exceeded, the scroll bar will automatically appear. visitors can drag the scroll bar to view the options.
The syntax format is as follows:
Option 1Option 2Option 3...
The parameter name indicates the name of the selected field, the size indicates the number of rows in the list, the value indicates the menu option value, the multiple parameter indicates that the data is displayed in the menu mode, and the data is displayed in the list mode if it is omitted.
C) text domain mark<Textarea>
Text field mark <Textarea> You can enter more text in the text field of multiple lines. The syntax format is as follows:
... // Text content
The parameter name indicates the name of the text field, rows indicates the number of lines of text, and cols indicates the number of columns of text (here rows and cols are both in characters). value indicates the default value of the text field, wrap is used to set the line feed mode for display and output. if it is set to off, the line feed is not automatically generated. if it is set to hard, the line feed is automatically inserted and the line feed mark is sent to the server together, the line feed is also displayed. soft indicates that the line feed is automatically soft. The line feed mark is not sent to the server and is still a column in the output.