Sorry, password was incorrect
<?php
$actualPassword = "abc123";
$passwordHash = password_hash($actualPassword,PASSWORD_DEFAULT); // -- In this example, the hash is just generated here
// But this is most likely stored in the database
// So you would retrieve it and then use below
//The password that was submitted on the form
$_POST['submittedPasswordToTry'] = "pass1234"; //Currently not the correct password, so it will fail
//TO CHECK IF A GIVEN PASSWORD IS CORRECT
//STEP 1 - Login webfrom (ask for username, password)
//STEP 2 - SELECT all users with that username
//STEP 3 - Compare the submitted password with the hash from that username
if (password_verify($_POST['submittedPasswordToTry'], $passwordHash)) {
// Success!
echo "If you got here, the password was correct";
}
else {
// Invalid credentials
echo "Sorry, password was incorrect";
}
?>
<?php //WILL DISPLAY CODE OF THIS FILE ON THE WEBPAGE//
######################################################################
echo "<br/><br/><hr><hr>";
echo "<h2 style='text-align:center'>END OF OUTPUT</h2>\n";
echo "<hr><hr>";
echo "<h2><br>Source Code of ".basename((string)__FILE__) . "</h2><hr>";
show_source(__FILE__);
#######################################################################
?>