Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. function Check($username, $password) {
  2. if ($state = $mysqli->prepare("SELECT username, password FROM table-utenti WHERE username = ? LIMIT 1")) {
  3. $state->bind_param('s', $username);
  4. $state->execute();
  5. $state->store_result();
  6. $state->bind_result($db_username, $db_password, $db_nome);
  7. $state->fetch();
  8. $password = hash('sha512', $password);
  9. if($state->num_rows == 1) {
  10.  
  11. if($db_password == $password) {
  12. // Password corretta!
  13.  
  14. }
  15.  
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement