If you have any <?php ?> tags in your script, you have to save it with the extension .php . If you want to save it with .html extension, then you need to modify your htaccess file. You can make use of only 1 page/script to do everything.
-- list the comments here --
...
....
Have the fields for name, comments etc, with a submit button. When the form is submitted, get the values and insert it to the table ! A small example.
<?php
if(isset($_POST['submit'])){
$comment=$_POST['comment'];
$q="insert into comments_table (comment) values ('$comment')";
mysql_query($q);
}
$q="select comments from comments_table";
$result=mysql_query($q);
while($row=mysql_fetch_array($result)){
//list the comments
echo $row['comments']."";
}
?>
<html>
<body>
<form method="Post" action="comments.php">
<textarea name="comments" rows=30 cols=10></textarea>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html> This is just an example. And comments should be above the 'comment box'..
Cheers,
Naveen
nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356