为什么我点登陆的时候会报MD5的warning
为什么我点登陆的时候会报MD5的warning? Warning: md5() expects parameter 1 to be string, array given in F:\t1\muke-dianshang\shopImooc\admin\doLogin.php on line 11
为什么我点登陆的时候会报MD5的warning? Warning: md5() expects parameter 1 to be string, array given in F:\t1\muke-dianshang\shopImooc\admin\doLogin.php on line 11
2016-09-25
require_once '../include.php'; $username = $_POST['username']; $password = md5($_POST['password']); $verify = $_POST['verify']; $verify1 = $_SESSION ['verify']; $autoFlag=$_POST['autoFlag']; if ($verify == $verify1) { $sql = "select * from imooc_admin WHERE username = '{$username}' and password = '{$password}'"; $row = checkAdmin($sql); // var_dump($row); if($row){ //如果选了一周内自动登录 if($autoFlag){ setcookie("adminId",$row['id'],time()+7*24*3600); setcookie("adminName",$row['username'],time()+7*24*3600); } $_SESSION['adminName']=$row['username']; $_SESSION['adminId']=$row['id']; alertMes("登录成功","index.php"); }else{ alertMes("登录失败,重新登录","login.php"); } } else { alertMes("验证码错误。","login.php"); }
举报