始终显示登录错误,用Var_dump检查数组没有值。
<?php
session_start();
require_once '../include.php';
$username=$_POST['username'];
$password=md5($_POST['password']);
$verify=$_POST['verify'];
$verify1=$_SESSION['verify'];
if($verify==$verify1){
$sql="select * from imooc_admin where username='{$username}'and password='{$password}'";
$row=checkAdmin($sql);
var_dump($row);
if($row){
$_SESSION['adminName']=$row['username'];
//header("location:index.php");
//alertMes("登录成功啦","index.php");
}else{
//alertMes("登录失败啦,重新登录啊", "login.php");
}
}else{
alertMes("验证码错误啦", "login.php");
}