<?
  require '../config.inc.php';
  echo '
';
  if ($_POST['go_comments'])
  {
    if ((($_POST['name'] AND $_POST['email']) AND $_POST['article_comments']))
    {
      $_POST['article_comments'] = strip_tags ($_POST['article_comments']);
      $_POST['name'] = strip_tags ($_POST['name']);
      $_POST['email'] = strip_tags ($_POST['email']);
      $SQL = '' . 'INSERT INTO comments VALUES(\'\',\'' . $_POST['id'] . '\',\'' . $_POST['name'] . '\',\'' . $_POST['email'] . '\',\'' . $_POST['article_comments'] . '\',\'' . $curtime['0'] . '\')';
      if (!(mysql_query ($SQL)))
      {
        exit ('<b>Error:</b>' . mysql_error ());
        ;
      }

      echo '<div align="center"><input type="button" value="Close this window" onClick="javascript:self.close()"></div>';
    }
    else
    {
      echo 'All fields are required!<br><br>Pleasw <a href="javascript:history.go(-1)">go back</a> and try again...';
    }
  }

  echo '

';
  if ($_GET['id'])
  {
    echo '<FONT style="color:maroon;font-family:tahoma;font-size:11";></FONT>
<FONT style="color:navy;font-family:tahoma;font-size:11";>
<form action="comments.php" method="post">
* Your Name:<br>
<input type="text" name="name" STYLE="width: 340px;"><br>
* Your e-mail:<br>
<input type="text" name="email" STYLE="width: 340px;"><br>
* Your comment:<br>
<textarea cols="40" rows="12" name="article_comments"></textar';
    echo 'ea><br><br>
<input type="submit" name="go_comments" value="Submit">
<input type="hidden" name="id" value="';
    echo $_GET['id'];
    echo '">
</form>
</FONT>
';
  }

?>
