Advertisement
Guest User

Untitled

a guest
Apr 6th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2. include("connect.php");
  3.  
  4. if (isset($_SESSION["username"]))
  5. {
  6. $username = $_SESSION["username"];
  7. $password = $_SESSION["password"];
  8. $query = "select password from users where username = '$username'";
  9.  
  10.  
  11. $result = $mysqli->query($query);
  12. $rownum = mysqli_num_rows($result);
  13.  
  14. if ($rownum == 1)
  15. {
  16. while(list($hash) = $result->fetch_row())
  17. {
  18. if (password_verify($password, $hash))
  19. {
  20. //do nothing
  21. }
  22. else
  23. {
  24.  
  25. print ("<script> window.location.replace('https://firefly.uqcloud.net/App/Applogin.html'); </script>");
  26.  
  27. }
  28. }
  29. }
  30. else
  31. {
  32. print ("<script> window.location.replace('https://firefly.uqcloud.net/App/Applogin.html'); </script>");
  33. }
  34. }
  35. else
  36. {
  37.  
  38. print ("<script> window.location.replace('https://firefly.uqcloud.net/App/Applogin.html'); </script>");
  39.  
  40. }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement