Advertisement
MichalCzEJ

Untitled

Feb 21st, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  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. if (empty($username)) {
  6. array_push($errors, "Je vyžadováno jméno");
  7. }
  8. if (empty($password)) {
  9. array_push($errors, "Je vyžadováno heslo");
  10. }
  11.  
  12. if (count($errors) == 0) {
  13. $query = "SELECT * FROM users";
  14. $results = mysqli_query($db, $query);
  15.  
  16. while($row = mysqli_fetch_array($results))
  17. {
  18. if (password_verify($password, $row["password"])) {
  19. echo "Byl jste Úspěšně přihlášen";
  20. }
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement