此评论框应该将评论发送到我的数据库,然后将其显示在评论框下,但是当我提交评论时没有任何反应。它只是显示在数据库中。谢谢你 。
<?php
require ('connects.php');
$comment=$_POST['comment'];
$submit=$_POST ['submit'];
if ($submit) { $insert=mysql_query ("INSERT INTO comment (comment) VALUES ('$comment')" ) ;
}
?>
<html>
<head><title>Comment Box | HelperTuts</title></head>
<body>
<form action="comment-box.php" method="POST">
<label>Comment: </label><br />
<textarea name="comment" cols="25" rows="7"></textarea><br /><br /><br />
<input type="submit" name="submit" value="Comment" /><br />
</form>
<hr width="1100px" size="5px" />
<?php
$getquery="SELECT comment FROM comment ORDER id DESC " ;
while($rows=mysql_fetch_assoc($getquery))
{
$id=$rows['id'] ;
$comment=$rows['comment'];
echo $comment["comment"] ;
}
?>
</body>
</html>