Advertisement
Guest User

Untitled

a guest
Oct 29th, 2018
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if ( count($errors) == 0 )
  2.       {
  3.           $password = md5($password);
  4.           $query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
  5.           $results = mysqli_query($db, $query);
  6.           if ( mysqli_num_rows($results) == 1 )
  7.           {
  8.               $_SESSION['username'] = $username;
  9.               $_SESSION['success'] = "You are now logged in";
  10.               header('location: index.php');
  11.           }
  12.           else
  13.           {
  14.               array_push($errors, "Wrong username/password combination");
  15.           }
  16.       }
Advertisement
RAW Paste Data Copied
Advertisement