$username = $_POST['username'];
$password =md5($_POST['password']);
$verify = $_POST['verify']; //输入的值
$verify1 = $_SESSION['verify']; //自动生成的值
echo $verify ;
echo "</br>";
echo $verify1;
if($verify==$verify1){
$sql="select * from imooc_admin where username='{$username}'and password='{$password}'";
$res=checkAdmin($sql);
print_r($res);
}else{
echo "<script>alert('验证码错误');</script>";
echo "<script>window.location='login.php';</script>";
}
我将两个数值进行了输出,发现$verify的值是对的,但是自动生成的$verify1的值是固定的05789,所以永远匹配不上,求大神解释下,问什么从$_SESSION中取的数据不对。
mooc用户18273