PHP Comment Code Check?

Micro Sniff

New member
I have a non sql comment system using one html form and then a php page. you can view it here.

http://www.patmr.com/comment/comment.html


Here is the comment html page:

<html>
<head>
<title>Comment</title>
</head>
<body style="font-family: verdana; font-size: 16; color black;">
<form action="post.php" method="post">
<table style="border: 1px solid #000000; padding: 10px; margin: 10px;">
<tr>
<td>
Name:
</td>
<td>
<input type="text" name="name"/>
</td>
</tr>
<tr>
<td>
Message:
</td>
<td>
<textarea name="message">
</textarea>
</td>
</tr>
<tr>
<td>
</td>
<td style="font-family: verdana; font-size: 16;">
<input type="submit" name="submit" value="Comment">
</td>
</tr>
</table>
</form>
</body>
</html>




and here is the PHP page:

<html>
<head>
<title>Comment Posted</title>
</head>
<body>
<?
$name = $_POST['name'];
$message = $_POST['message'];
$fp = fopen($_SERVER ['DOCUMENT_ROOT'] ."/youtube/comments.php", 'a');
if (! $fp)
{
echo "There was an error posting your comment.";
exit;
}
else
{
$outputstring = "<br>Name: " ,$name, "<br> Comment:<br/>" , $message, "<br>";
fwrite($fp, $outputstring, strlen($outputstring);
fclose($fp);
echo "Your comment was posted successfully. Click <a href="comment.html">here</a> to go back to the lat page.";
}
?>
</body>
</html>


Can anyone check the PHP code to see if they see any errors? I don't know why its not working.
 
Back
Top