SHARE
TWEET

Untitled

a guest Aug 18th, 2018 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (isset($_POST['login_user'])) {
  2.   $username = mysqli_real_escape_string($db, $_POST['username']);
  3.   $password = mysqli_real_escape_string($db, $_POST['password']);
  4.  
  5. ..
  6.  
  7.   if (count($errors) == 0) {
  8.     $password = md5($password);
  9.     $query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
  10.     $results = mysqli_query($db, $query);
  11.     if (mysqli_num_rows($results) == 1) {
  12.       $_SESSION['username'] = $username;
  13.       $_SESSION['success'] = "You are now logged in";
  14.       header('location: ../sip/index.php');
  15.     }else {
  16.         array_push($errors, "Wrong username/password combination");
  17.     }
  18.   }
  19. }
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