if(!$con) {
die ('Could not connect:'.mysql_error( ) );
}
mysql_select_db("user",$con);
$sql = "select name,password from usermsg where name='$username'";
//echo $sql;
$dbt=mysql_query($sql,$con);
//echo $dbt;
$num=mysql_num_rows($dbt);
echo $num;
if($num>0)
{
session_srart();
$_SESSION["login"]=true;
header("Location:favor.php");
exit;
}
else {
echo"<center><font color =red>登录失败!请检查用户名和密码!</font></center><br>";
}
}