Advertisement
Guest User

Untitled

a guest
Jan 4th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. if (count($errors) == 0) {
  2. //$password = md5($password);
  3. $query = "SELECT * FROM users WHERE username='$username' AND password='$password'";
  4. $result = mysqli_query($db, $query);
  5. if (mysqli_num_rows($result) == 1) {
  6. $_SESSION['username'] = $username;
  7. $_SESSION['success'] = "You are now logged in";
  8. header('location: index.php');
  9. }else {
  10. array_push($errors, "Wrong username/password combination");
  11. echo '<script language="javascript">';
  12. echo 'alert("Wrong username/password combination")';
  13. echo '</script>';
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement