Guest User

Untitled

a guest
Feb 6th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. // Create connection
  2. $conn = new mysqli($servername, $username, $password, $dbname);
  3.  
  4. $sql = "SELECT Status FROM Users WHERE Username = ? AND Password = ?";
  5. $stmt = $conn->prepare($sql);
  6. $stmt->bind_param("ss", $_GET['username'], $_GET['password']);
  7. $stmt->execute();
  8. $result = $stmt->get_result();
  9. $rows = $result->fetch_all(MYSQLI_ASSOC);
  10.  
  11. if ($result->num_rows > 0) {
  12. // output data of each row or remove while loop if you wish
  13. while($row = $result->fetch_assoc()) {
  14. echo "<b style='color:green'>Found</b>";
  15. }
  16. } else {
  17. echo "0 results";
  18. }
  19. $conn->close();
  20. ?>
  21.  
  22. $sql = "SELECT Status FROM Users WHERE Username = ? AND Password = ?";
  23. $stmt = $conn->prepare($sql);
  24. $stmt->bind_param("ss", $_GET['username'], $_GET['password']);
  25. $stmt->execute();
  26. $result = $stmt->get_result();
  27. $rows = $result->fetch_all(MYSQLI_ASSOC);
  28.  
  29. password_hash($_GET['password'], PASSWORD_DEFAULT);
  30.  
  31. password_verify($_GET['password'], $hashedPasswordFromDatabase);
Add Comment
Please, Sign In to add comment