SHARE
TWEET

login

finalshare Mar 12th, 2018 (edited) 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <php?
  2.     if(isset($_POST["dangnhap"])){
  3.             $tk = $_POST["user_name_lg"];
  4.             $mk = md5($_POST["passlg"]);
  5.             $rows = mysqli_query($connect,"
  6.                 select * from user where user_name = '$tk' and password = '$mk'
  7.             ");
  8.             $count = mysqli_num_rows($rows);
  9.             if($count==1){
  10.                 $result = mysqli_query($connect,"
  11.                 select * from user where user_name = '$tk' and password = '$mk'
  12.             ");
  13.                 $row = mysqli_fetch_assoc($result);
  14.                 $_SESSION['score'] = $row['score_max'];
  15.                 $_SESSION['name'] = $_POST["user_name_lg"];
  16.                 $_SESSION['pass']= md5($_POST["passlg"]);
  17.                 $_SESSION["loged"] = true;
  18.                 header("location:index.php");
  19.             }
  20.             else{
  21.                 header("location:index.php");
  22.                 setcookie("error", "Đăng nhập không thành công!", time()+1, "/","", 0);
  23.             }
  24.            
  25.         }
  26.     ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top