Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST["login"])){
- $username = $_POST["username"];
- $password = $_POST["password"];
- $password_hashed = password_hash($password,PASSWORD_DEFAULT);
- $SQL = "SELECT `username`, `password` FROM `users` WHERE `username` = ?";
- if($stmt = $conn->prepare($SQL)){
- $stmt->bind_param("s", $username);
- $stmt->bind_result($username, $password_hashed);
- if($stmt->execute()){
- $stmt->store_result();
- if($stmt->num_rows == 1){
- $stmt->fetch();
- if(password_verify($password, $password_hashed)){
- echo "U bent nu ingelogd.";
- } else {
- echo "Inloggen mislukt.";
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement