php如何 阻止表单提交? 15
代码如下,在未登录的情况下是禁止提交数据的,于是我写了returnfalse,结果页面在弹出提示信息后一篇空白,是怎么回事??$_iptTitle=$_POST['ipt...
代码如下,在未登录的情况下是禁止提交数据的,于是我写了return false,结果页面在弹出提示信息后一篇空白,是怎么回事??
$_iptTitle=$_POST['iptTitle'];
$_iptContent=$_POST['iptContent'];
if(isset($_POST['btnsugg'])){
if(!$_SESSION['userName']){
echo '<script>alert("请先登录系统!");</script>';
return false;
}else{
mysql_query("INSERT INTO suggestionbox(suggestionTitle,suggestionContent,createTime) VALUES ('$_iptTitle','$_iptContent',now())");
echo '<script>alert("意见发送成功!");</script>';}
//echo $_iptContent;
} 展开
$_iptTitle=$_POST['iptTitle'];
$_iptContent=$_POST['iptContent'];
if(isset($_POST['btnsugg'])){
if(!$_SESSION['userName']){
echo '<script>alert("请先登录系统!");</script>';
return false;
}else{
mysql_query("INSERT INTO suggestionbox(suggestionTitle,suggestionContent,createTime) VALUES ('$_iptTitle','$_iptContent',now())");
echo '<script>alert("意见发送成功!");</script>';}
//echo $_iptContent;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询