PHP blog

I’m building my own little blog app for my May 1st reboot and I’ve run into a small issue with the user comments. At the moment I’m just building the form to submit them but there seems to be an error in the submit comments loop. The file is attached so if anyone could take a look and perhaps suggest a fix I’d be very grateful.

Thanks all.

<?php
include ("php/conn.php");  
$sql = "SELECT * FROM $conTable WHERE id=$id";
$result = mysql_query($sql) or die("<p>Failed to select categories</p>" . $sql . "<br />" . mysql_error()); 
while ($row = mysql_fetch_assoc($result)){
		  $id = $row["id"];
		  $blogID = $row["id"];
		  $date = date("D tS F",$row["timestamp"]);
	$title = $row["title"];
	$summaryContent = $row["summaryContent"];
	$mainContent = $row["mainContent"];
} 
if ($_POST[submitComment] != "") { 
	$timestamp=strtotime("now");
	$result = mysql_query("INSERT INTO $comTable (timestamp,blogID,userName,userEmail,userURL,mainContent) VALUES ('$timestamp','$blogID','$userName','$userEmail','$userURL','$mainContent')"); 
	header("Location: index.php");
}
?>
<!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">
<head>				   
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title>Minimology &raquo; Archives &raquo; <? echo "$title"; ?></title>				 
	<link rel="stylesheet" type="text/css" media="all" href="css/low.css" />
	<style type="text/css" media="screen, projector">/* <![CDATA[ */ @import url(css/index.css); /* ]]> */</style>
</head>
<body id="home">
		   <div id="wrapper">
		 	<h1><a href="/">Minimology</a></h1> 
		<ul id="nav">
			<li id="journalLink"><a href="/" title="Go Home">Journal</a></li>
			<li id="archivesLink"><a href="/archives/" title="Archived Bloggage">Archives</a></li>
			<li id="aboutLink"><a href="/about/" title="A Lil Background On Me">About</a></li>
			<li id="elsewhereLink"><a href="/elsewhere/" title="Linkies From The Past">Elsewhere</a></li>
			<li id="contactLink"><a href="/contact/" title="Hail Me">Contact</a></li>
		</ul>
		<div id="content">
			<div id="mainContent">
	 		 	<h2>Latest</h2>
<?php
	echo "					<h3><a href=\"display.php?id=$id\" title=\"Read On At This Articles Permanent Address\">$title,</a> <span>$date</span></h3>
";
	echo "						$summaryContent
";  
	echo "						$mainContent
";  
?>		   
		 		<h3><a href="#anchorCommentsForm" name="anchorCommentsForm" id="anchorCommentsForm" title="Share Your Thoughts">Any Thoughts?</a> <span>Then run 'em by me.</h3>
		    		    <fieldset>
		 		 	<legend>Details</legend>
		 	 		 	<form action="<? echo $PHP_SELF ?>">
		 			 		 <label>Name : <input type="text" name="userName" /></label> 
		 			 		 <label>Email : <input type="text" name="userEmail" /></label> 
		 			 		 <label><acronym title="Uniform Resource Locator">URL</acronym> : <input type="text" name="userURL" /></label> 
		 			 		 <label>Comment : <textarea name="mainContent"></textarea></label>
		 			 			<input type="submit" name="submitComment" value="Post" />
		 			 		</form>
		    		    </fieldset>
			</div>
			 <div id="sidebar">
			 		<h2>Other Musings</h2>
			 		 <h3>Playlist, <span>The Jukebox Is Back</span></h3>
			 		 	<p>
			 		 	</p>
			</div>
		<div class="separator">
		 	 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::;
		</div>
		<div id="footer">
		 <p>&copy; <a href="/about/" title="A Little Background Info On The Me">Chris Garrett</a> 2005, All rights reserved.</p>
		 <p>Mandatory acronyms: <a href="/syndicate/" title="Get Updates On Call"><acronym title="Really Simple Syndication">RSS</acronym> Feed</a> - <a href="#" title="Valid XHTML">Valid <acronym title="eXtensible Hyper Text Markup Language">XHTML</acronym></a> - <a href="#" title="Valid CSS">Valid <acronym title="Cascading Style Sheet">CSS</acronym></a></p>
		</div>
		 </div>
		   </div>
</body>
</html>