<?php
error_reporting(E_ALL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
  <title>Example</title>
</head>
<body>
<h1>My ice cream shop</h1>
<?php
if (empty($_GET['yourname'])) {
  echo "<b>Error:</b> You didn't type in your name!<br />";
} else {
  echo "Welcome, " . $_GET['yourname'] . '!';
  echo '<br />';
}

$icecream_choices = array('greentea', 'chocolate', 'vanilla');

if (!in_array($_GET['icecream'], $icecream_choices)) {
  echo "<b>Error:</b> You didn't submit the form correctly.<br />";
} else {
  echo "Your favorite type of ice cream is " . $_GET['icecream'] . '. Yum!';
  echo "<br />";
}

if (isset($_GET['cone'])) {
  echo "You want a cone";
} else {
  echo "You don't want a cone :(";
}
echo '<br />';

echo "You want the following topping: " . $_GET['topping'];
?>
</body>
</html>
