jingangel
中级会员
 
UID 72698
精华
0
积分 350
帖子 244
金钱 350 喜悦币
威望 0
人脉 0
阅读权限 30
注册 2006-5-2 来自 山西
状态 离线
|
关于变量撤消的问题
if(!empty($_POST["submit"]))
{
$articleid = $_POST["articleid"];
$comment = $_POST["comment"];
$author = $_POST["author"];
$ip = $_SERVER["REMOTE_ADDR"];
$datetime = date("Y-m-d H:i:s");
$sql = "insert into `comment` set articleid = $articleid, `comment` = '$comment', author = '$author', ip = '$ip', `datetime` = '$datetime'";
$rs = mysql_query($sql);
unset($_POST["submit"]);
if(!$rs){ echo "<script language='javascript'>alert('评论发表失败');history.go(-1);</script>";}
else { echo "<script language='javascript'>alert('评论发表成功');</script>";}
}
请问为什么发表评论之后,刷新还会自动发表空评论,
该怎么解决,谢谢
|  http://www.zshome.net.cn 装饰·家 新站上市 |
|