Advertisement
Guest User

Untitled

a guest
Jul 4th, 2018
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. include_once("../config.php");
  4.  
  5. $user = $_POST["username"];
  6. $pass = $_POST["password"];
  7.  
  8. if(isset($user) && isset($pass)):
  9.     $query = mysqli_query($connect,"SELECT username,password FROM table_admin WHERE username='$user' AND password='$pass'");
  10.     $check = mysqli_fetch_array($query,MYSQLI_ASSOC);
  11.     if($check){
  12.         setcookie("user",$user,time() + 7200,"/");
  13.         header("Location: admindex.php");
  14.     }else {
  15.         header("Location: index.php?msg=contol");
  16.     }
  17. endif;
  18.  
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement