<?php

if(!$_GET['comment']) {	
	$filename = $_GET['url'];
	$title = $_GET['title'];
	echo ('You forgot to enter a comment!  
		<form action="commentpost.php" name="commentpost" method="post">
		<input type="hidden" name="filename" value="'.$filename.'">
		<input type="hidden" name="title" value="'.$title.'">
		<font color="#CC0033" size="3"><input name="submit" type="submit" value="Go back and try again"/></font>
		</form><br>');
	}
if(!$_GET['name']) {
	$filename = $_GET['url'];
	$title = $_GET['title'];
	echo ('You forgot to enter a name! 
		<form action="commentpost.php" name="commentpost" method="post">
		<input type="hidden" name="filename" value="'.$filename.'">
		<input type="hidden" name="title" value="'.$title.'">
		<font color="#CC0033" size="3"><input name="submit" type="submit" value="Go back and try again"/></font>
		</form><br>');
	}
elseif(!$_GET['filename']) {
	echo ('Trouble!  The script encountered an error.  Wait a minute and try again, or contact the webmaster. ');
	}	
elseif(!$error) {	
	$filename = $_GET['filename'];
	$title = $_GET['title'];
	$name = $_GET['name'];
	$comment = $_GET['comment'];
										
$db = @mysql_connect("mysql.csail.mit.edu", "filmsai", "filmsAI+3456")
	or die('Error!  The script couldn\'t connect to the server.  Please try again in a minute or contact the webmaster.  ');
@mysql_select_db("filmsAI",$db)
	or die('Error!  The script encountered a database error.  Please try again in a minute or contact the webmaster.  ');

$pointer = @mysql_query("SELECT `pointer` FROM `comments` WHERE (filename=$filename)", $db) OR die("Awww, poop.");

?>