随便输入个账号都可以登陆 正确账号居然是空白 求解
<?php
echo <<<文件头
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "
http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
<title>登陆</title>
</head>
<body>
文件头;
$name=$_POST['name'];
$pass=$_POST['pass'];
if($name and $pass){
$db=mysql_connect("mysql.iqdo.info","u370929193_wyk","19960211");
mysql_select_db("u370929193_wyk",$db);
mysql_query("set character set 'utf8'");
mysql_query("set names 'utf8'");
$sql="SELECT * FROM user
WHERE name='$name'";
$b=mysql_query($sql);
$row=mysql_fetch_array($b);
$user=$row['name'];
$passd=$row['password'];
if(empty($user)){
$err='用户不存在';
}
if($pass!=$passd){
$err='密码错误';
}
if($err){
echo '本次登陆成功了!<br/> <a href="./index.php">返回首页</a>';
}else{
echo $err;
}
}else{
echo <<<登录
<form method="post" action="dl.php">
用户名<br><input type="text" name="name" /><br>
密码<br><input type="password" name="pass" /><br>
<input type="submit" name="sub" value="登陆" />
</form>
登录;
}
echo'</body>
</html>';
?>