if(!isset($_POST['submit'])){
exit('非法访问!');
}
$username=htmlspecialchars($_POST["用户名"]);
var_dump($username);
$password=MD5( $_POST["密码"]);
$con=mysqli_connect('localhost','root','greg1997714','ky');
if(mysqli_errno($con) )
{
echo 'mysqli_error($con)';
exit;
}
$sql1="select user_name ,user_password from users where user_name='$username' limit=1";
$sql2="select user_name,user_password from users where user_name='$username' and user_password='$password' limit=1" ;
$result = mysqli_num_rows(mysqli_query($con,$sql1));
echo $result;
if($result)
{
echo"";
退出;
mysqli_close($con);
}
$result = mysqli_num_rows(mysqli_query($con,$sql2));
if($result)
{
echo" ;”;
exit;
mysqli_close($con);
}
echo"登陆成功!";
mysqli_close($con);
?>
$_POST["username"] 有获取到值吗,如果没有 说明post请求本身就存在问题