Created
November 14, 2018 10:56
-
-
Save ErMandeep/2a813abde166b915ea2554ff5e868b78 to your computer and use it in GitHub Desktop.
password hashing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$password = $_POST['password']; | |
$hashed_password = password_hash($password, PASSWORD_DEFAULT); | |
// Query the database for username and password | |
// ... | |
if(password_verify($password, $hashed_password)) { | |
// If the password inputs matched the hashed password in the database | |
// Do something, you know... log them in. | |
} | |
// Else, Redirect them back to the login page. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment