登陆页面login.html
表单
<form action="pagelogin.php" target = 'login' method="post" enctype='multipart/form-data'>
...
</form>
验证php ----pagelogin.php
<?php
。。。
echo "<script language=javascript>alert('登陆成功');window.location.href='index.html'</script>";
?>
但验证完后JS无法实现跳转。请大师帮忙
非常谢谢大家的回答,最好找到解决方法了,我用的iframe伪装的无网页刷新,但是我的iframe长宽及边框都设置为0,导致看不到输出结果,最后用下面办法实现了自动跳转至主页:
echo "<script>window.top.location.replace('../index.html')</script>";,这里一定要用window.top,不然php返回结果直接进iframe了,不会直接回主页。很感谢大家的回答,这次由于分不多,就暂留小弟这了。新年快乐
<?php if($record == mysql_fetch_array($result,MYSQL_NUM)) {echo "<script>alert('成功登陆!');</script>"; echo "<script language=javascript>alert('登陆成功');window.location.href='index.html'</script>"; exit();}
else{
echo "数据读取失败";
}
?>
echo "<meta http-equiv=refresh content=0.1;url=index_ws.php >";
exit;
我一般这么写追问
试过了,貌似不行啊,我帖详细点吧
php内容:
alert('成功登陆!');";
echo "";
exit;
}
?>
试过了,貌似不行啊,我帖详细点吧
php内容:
alert('成功登陆!');";
echo "";
exit;
}
?>
你上边的那个判断是什么呀?我看着像计数判断?
我的登陆判断,只是确定帐号密码是否相符,
我的回答,只解答,JS跳转失败后,可以试用网页自然跳转,然后,终止所有网页响应,
可你现在可能是判断,有点乱,你理清一下思路,看看问题出现的 位置是不是有点问题!
header('location: index.html');