Form select input : Form Select « Form « PHP

Form select input

<TITLE>Candy preference form</TITLE>
<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">

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


Related examples in the same category

1.An HTML Form Including a SELECT Element
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