Form select input : Form Select « Form « PHP






Form select input

       
       
<HTML>
<HEAD>
<TITLE>Candy preference form</TITLE>
</HEAD>
   
<BODY>
<FORM ACTION="SelectFormControlHandler.php" METHOD="POST">
What's your most favorite kind of candy?<BR>
<INPUT TYPE="radio" NAME="Candy" VALUE="peanut butter cups">Peanut butter cups<BR>
<INPUT TYPE="radio" NAME="Candy" VALUE="Snickers">Snickers<BR>
<INPUT TYPE="radio" NAME="Candy" VALUE="Turtles">Turtles<BR>
<INPUT TYPE="submit">
</FORM>
</BODY>
</HTML>


<!-- SelectFormControlHandler.php
<HTML>
<HEAD>
<TITLE>Candy preference reply</TITLE>
</HEAD>
   
<BODY>
Yum, <?php print("$Candy!  ");
if($Candy == "peanut butter cups"){
  print("peanut butter cups");
  print(" $Candy.");
}else{
  print("$Candy");
  if($Candy == "Snickers"){
    print("Snickers");
  }elseif($Candy == "Turtles"){
    print("Turtles");
  }
}
?>
</BODY>
</HTML>
-->


           
       








Related examples in the same category

1.An HTML Form Including a SELECT Element
2.A
3.A day choice
4.An HTML Form with a select Element
5.Validating a drop-down menu with in_array()
6.Displaying a
7.Generating a dynamic pull-down menu
8.Setting a default value in a
9.Setting defaults in a multi-valued
10.Creating Form Elements Based on the Current Time and/or Date
11.Creating Form Elements with Multiple Options
12.One choice for each day from 1 to 31
13.One choice for each year from last year to five years from now