Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <php?
- if(isset($_POST["dangnhap"])){
- $tk = $_POST["user_name_lg"];
- $mk = md5($_POST["passlg"]);
- $rows = mysqli_query($connect,"
- select * from user where user_name = '$tk' and password = '$mk'
- ");
- $count = mysqli_num_rows($rows);
- if($count==1){
- $result = mysqli_query($connect,"
- select * from user where user_name = '$tk' and password = '$mk'
- ");
- $row = mysqli_fetch_assoc($result);
- $_SESSION['score'] = $row['score_max'];
- $_SESSION['name'] = $_POST["user_name_lg"];
- $_SESSION['pass']= md5($_POST["passlg"]);
- $_SESSION["loged"] = true;
- header("location:index.php");
- }
- else{
- header("location:index.php");
- setcookie("error", "Đăng nhập không thành công!", time()+1, "/","", 0);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement