header( 'Content-Type:text/html;charset=utf-8 ');
session_start();
include_once("conn/conn.php");
 $name=$_POST["username"];
 $pass=$_POST["password"];

$sql="SELECT * from user where username='$name' and password='$pass'";
 $r=mysqli_query($link,$sql);
 $n=mysqli_num_rows($r);

if($r>0){

   header('location:welcome.html');
   }else{
    echo "<script>alert('账号或密码错误');location.href='index1.php';</script>";
   }

posted on 2018-04-26 11:41  PHP`reader  阅读(124)  评论(0编辑  收藏  举报