monty.php

Source of monty.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/xml; charset=utf-8" />
    <title>monty.php</title>
    <!-- Meant to run from monty.html -->
  </head>

  <body>
    <h1>Monty Python quiz results</h1>
    <?php
      //gather the variables
      $name = $_REQUEST["name"];
      $quest = $_REQUEST["quest"];
      $nose = $_REQUEST["nose"];
      $hat = $_REQUEST["hat"];
      $newt = $_REQUEST["newt"];

      //send some output
      $reply = <<< HERE
    <p>
      Your name is $name.
    </p>
    
    <p>
      Your quest is $quest.
    </p>
    
HERE;
      print $reply;    

      //determine if she's a witch
      $witch = false;
      if ($nose != ""){
        $witch = true;
      } // end if

      if ($hat != ""){
        $witch = true;
      } // end if

      if ($newt != ""){
        $witch = true;
      } // end if

      if ($witch == true){
        print "<p>She's a witch!</p> \n";
      } // end if
    ?>
  
  </body>
</html>