<?php
$user=$_POST['user'];
$password=$_POST['password'];
$conn=mysql_connect("localhost","root","123456");
if(!$conn){
die("连接失败".mysql_erron());
}
//设置编码
mysql_query("set names utf8",$conn) or die("编码设置失败");
//选择数据库
mysql_select_db("emplpoyadmin",$conn)or die(mysql_errno());
//对比用户名
$sql="select password from employ where 'user'='$user'" ;
//获取数据
$res=mysql_query($sql,$conn);
//密码验证
if ($row = mysql_fetch_assoc($res)) {
if ($row['$_password']==md5($password)) {
header("Location:empManage.php");
exit();
}
}
header("Location:denglu.php?errno=1");
exit();
mysql_free_result($res);
mysql_close($conn);
php?>
这段是自己写的用户名密码验证代码,但是密码输入正确后验证页面始终是白板,也不跳转,求救。