<?php
$question = $_REQUEST["question"];
$choices = file("sayings.txt");
$answer = $choices[rand(0, count($choices) - 1)];   # pick random answer
?>
<!DOCTYPE html>
<html>
  <head>
    <title>Magic 8-Ball</title>
    <link href="8ball.css" type="text/css" rel="stylesheet" />
  </head>

  <body>
    <p>The answer to, <strong><q><?= htmlspecialchars($question) ?></q></strong>, is:</p>
    <div id="eightball"> <?= htmlspecialchars($answer) ?> </div>
  </body>
</html>
