How does a website interact with users? The answer is to use an HTML form (form). The form can transfer the data entered by the browser to the server side, so that the server-side program can process the data that the table only son over.
Grammar:
<form method= "transfer mode" action= "Server file" >
Explain:
1.<form>:<form> label is in pairs appear, start with <form>, end with </form>.
2.action: Where the data entered by the browser is transmitted, such as a PHP page (save.php).
3.method: The way data is transmitted (Get/post).
<form method= "POST" action= "save.php" > <label for= "username" > user name:</label> <input type= "text" name= "username"/> <label for= "pass" > Password:</label> <input type= " Password "name=" pass "/></form>
Attention:
1. All form controls (text boxes, text fields, buttons, radio boxes, checkboxes, and so on) must be placed between the <form></form> tags (otherwise the user input information can not be submitted to the server Oh!). )。
2, Method:post/get the difference this part of the content belongs to the back-end programmer to consider the problem.
Example:
<!DOCTYPE HTML><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Form Labels</title></Head><Body> <Div> <HR/> <formMethod= "POST"Action= "sava.php"> <label for= "username">User name:</label> <inputtype= "text"name= "username"ID= "username"value="" /> <BR/> <label for= "Pass">Password:</label> <inputtype= "Password"name= "Pass"ID= "Pass"value="" /> <BR/> <inputtype= "Submit"value= "OK"name= "Submit" /> <inputtype= "Reset"value= "Reset"name= "Reset" /> </form> <HR/> </Div> <Div> <P>The above is the content of the test</P> </Div></Body></HTML>
Effect:
Use form labels to interact with users