daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest Aug 13th, 2016 190 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(isset($_POST['login']))
  2. {
  3.     $username = mysqli_real_escape_string($connect, $_POST['user']);
  4.     $password = mysqli_real_escape_string($connect, $_POST['pass']);
  5.  
  6.     $query = mysqli_query($connect, "SELECT * FROM users WHERE password='$password' and username='$username'");
  7.     $row = mysqli_fetch_array($query);
  8.     $num_row = mysqli_num_rows($query);
  9.  
  10.  
  11.     if($num_row > 0)
  12.     {
  13.         $_SESSION['user_id']=$row['user_id'];
  14.         header('location: index.php');
  15.     } else {
  16.         echo "You've entered an invalid username or password.";
  17.     }
  18. }
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