php 写的html script标签内的alert没反应
代码:<?phprequire_once('include.php');$email=$_POST['email'];$password=md5($_POST['pass...
代码:
<?php
require_once ('include.php');
$email=$_POST['email'];
$password=md5($_POST['password']);
$verify=$_POST['verify'];
$imgVerify=$_SESSION['verify'];
if ($verify==$imgVerify) {
$sql="select * from tuuup_user where email='{$email}' and password='{$password}'";
$res=checkUser($sql);
print_r($res);
}else{
echo "<script>alert('验证码错误');<script>";
echo "<script>window.location='Signin.php';<script>";
}
?>
我故意输错验证码,逻辑上来说应该是警告然后跳转,实际上直接白页了,求大神指点。谢谢 展开
<?php
require_once ('include.php');
$email=$_POST['email'];
$password=md5($_POST['password']);
$verify=$_POST['verify'];
$imgVerify=$_SESSION['verify'];
if ($verify==$imgVerify) {
$sql="select * from tuuup_user where email='{$email}' and password='{$password}'";
$res=checkUser($sql);
print_r($res);
}else{
echo "<script>alert('验证码错误');<script>";
echo "<script>window.location='Signin.php';<script>";
}
?>
我故意输错验证码,逻辑上来说应该是警告然后跳转,实际上直接白页了,求大神指点。谢谢 展开
1个回答
推荐于2016-06-01
展开全部
require_once ('include.php');
$email=$_POST['email'];
$password=md5($_POST['password']);
$verify=$_POST['verify'];
$imgVerify=$_SESSION['verify'];
if ($verify==$imgVerify) {
$sql="select * from tuuup_user where email='{$email}' and password='{$password}'";
$res=checkUser($sql);
print_r($res);
}else{
echo "<script>alert('验证码错误');</script>"; //错误在这里,没有结束标签
echo "<script>window.location='Signin.php';</script>"; //这里也没有结束标签
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询