<html>
<head><title> CS330 Anonymous comments </title>

</head>


  
<?php 
	if (isset( $_POST["entry"])) {
		$filename= "log.html" ; 
		$dstamp = date ("F dS, Y H:i:s");
		$input = ereg_replace ("\n", "\n<br>\n", $_POST["entry"]);
		
		$handle= fopen ($filename , "a") or die ("Uhoh! I cant open $filename") ; 

		fwrite ($handle , "<tr valign='top'> \n\t <td width='80'><font size='-2'>\n\t\t\t $dstamp \n\t </font></td> \n" );
		fwrite ($handle , "\n\t <td>\n\t\t $input\n\t </td> \n</tr>\n\n\n");
		fclose($handle) ; 
	}
  ?>

	<h2 align="center"> CS330 Anonymous comment submission form </h2>

Use this form to provide anonymous comments (all I can see is the IP 
address of the machine you are using to view this webpage) about the 
class. Specific questions I would like to hear about: What do you like ? 
What's causing trouble ? Any suggestions ? 

<br> 
<a href = "jan_log.html"> January Comments </a> 
<br> 
<a href = "february1.html"> February Comments </a> 
<br> 
<a href = "midterm.html"> Midterm Comments </a> 
<br> 
	<form name="log" action="./log.php" method="post">	
	
		<table width="75%" border="0" cellspacing="0" cellpadding="5">
		  <tr> 
			<td width="120" align="center" valign="bottom"><h4>Log Entry</h4></td>
			<td rowspan="2" align="center" valign="top"><textarea name="entry" cols="72" rows="6" id="entry"></textarea></td>
		  </tr>
		  <tr> 
			<td width="120" align="center"> 
			  <input name="submit" type="submit" id="submit" value="Add Entry">
			</td>
		  </tr>
		</table>
	
	</form>
	
	<p align="center">
		<table width="75%" border="0">
			<? include('log.html') ?>
		</table>
	</p>

</body>
</html>

