<p> Definition and Usage A radio box is used when a user chooses one of several given choices. <br/> Syntax <input type= "Radio" name= "Sex" value= "male" > Male <br/> <input type= "Radio" name= "Sex" value= "female" > Female <br/> Parameter Description type The type of the form. One of the radio represents a radio button. <BR the name of the/> name option. You can define your own name. <br/> Value is a radio button values, the above example "male" corresponds to the value is male, "female" corresponding to the value is "female" <br/> instance <? Php<br/> If ($_post[submit]== "submit") { If the user submits the data <br/> echo "You have chosen". $_post[sex]; The value of the output radio button <br/>}<br/>? ><br/> <html><br/> <head><br /> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "><br/> <tItle> get the value of a radio button-www.dushuwu.net</title><br/> </head><br/> < body><br/> <form name= "Form1" method= "Post" action= "&LT;? =$_server[' php_self '?> " ><br/> Male: <br/> <input type= "Radio" checked= "Checked" name= "Sex" value= "male" ><br/> <br ><br/> Female: <br/> <input type= "Radio" name= "Sex" value= "female" ><br/> < Input type= name= "Submit" value= "Submission" ><br/> </form><br/> </body& Gt;<br/> </html> </p>
The above is the basic PHP Tutorial: Form Gets the value of the radio button to get the content, more relevant content please follow topic.alibabacloud.com (www.php.cn)!