Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function doLogin($username,$password)
- {
- $hash = password_hash($password, PASSWORD_DEFAULT);
- $stmt = $this->mysqli->prepare("SELECT id FROM utenti WHERE username = ? AND password = ? ");
- $stmt->bind_param("ss",$username,$hash);
- $stmt->execute();
- $stmt->bind_result($id);
- $stmt->store_result();
- if($stmt->num_rows)
- {
- throw new Exception("Utente trovato");
- }
- throw new Exception("Utente o password errati!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement