<!--
    Brian Platz
    CS85 Section 1643
    Professor Geddes
    March 23, 2012
    Assignment: Test 1, problem 1    
            1. Display a form that asks the user for the following:
                name
                the time of day. options are: morning, afternoon, evening
            2.    When the user submits the form, a server-side script runs 
                and sends back the following:

                Hi _______, how are you this ______?
    --> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
   <head>
      <title>Test 1, Problem 1</title>
      <style type="text/css">
         body {background-color:#90EE90}
         h1 {color:black; font-family:Ariel; font-size:14pt; 
                 font-weight:bold; text-align: center}
         h2 {color:red; font-family:Ariel; font-size:14pt; font-weight:bold}
         h3 {color:black; font-family:Ariel; font-size:24pt; font-weight:normal}
         .center {margin-left: auto;
                    margin-right: auto;
                    width: 6em;}
      </style>    

   </head>
   <body> 
      <?php
        extract
($_REQUEST); //kg: create form variables
        
error_reporting(E_ALL & ~E_NOTICE); //kg: get rid of run-time notices
          
if ( $_GET["user"] ) {
              
$user $_GET["user"];
              
$time_day $_GET["time_day"];
              echo <<<HERE
                  <h1>Hi, $user, how are you this $time_day?<br/>
                  <input type='button' value='...again...' onclick='parent.location="test1_problem1.php"' /></h1>
HERE;
              
            } else {                        
// first time through...
            
echo <<<HERE
                <h1>Please submit the following information:</h1>
                <form method='get' action='test1_problem1.php' >
                  <h1>Your Name: <input type="text" id="user" name="user" size="25" maxlength="25"/></h1>
                  <h1>Time of Day: 
                    <select id="time_day" name="time_day" size="1" >
                      <option value="morning">Morning</option>
                      <option value="afternoon">Afternoon</option>
                      <option value="evening">Evening</option>
                    </select></label></h1>
                  <h1><button type='submit' value='Submit'>Submit</button> </h1>
                </form>
HERE;
            }

      
?>
   </body>
</html>