PHP: Hot Pages: A Poll

  1. Your Favorite Color
  2. PHP: Hot Pages
  3. SQLite

Here is a very simple poll to ask people what their favorite imaginary character is among a list of four characters: Neo, the Tin Man, the White Rabbit, and the Scarecrow.

<!doctype html>

<html lang="en">

<head>

<meta charset="utf-8">

<title>Best Imaginary Character</title>

<style>

body {

margin: 10em;

padding: 2em;

border: solid .2em green;

}

h1 {

text-align: center;

}

</style>

</head>

<body>

<h1>Imaginary Fight to the Finish</h1>

<form method="post" action="poll.php">

<p>

Please choose your favorite imaginary imaginary character:

<select name="character">

<option value="">Choose:</option>

<option value="rabbit">The White Rabbit</option>

<option value="scarecrow">The Scarecrow</option>

<option value="tinman">The Tin Man</option>

<option value="neo">Neo</option>

</select>

<input type="submit" value="Submit your answer" />

</p>

</form>

</body>

</html>

Save this as poll.php to your server, and try it out to make sure it works. It doesn’t currently do anything except display a pull-down menu and forget your choice as soon as you submit it.

image 11
  1. Your Favorite Color
  2. PHP: Hot Pages
  3. SQLite