2

For comparison, crypt function is used in a slightly different way. It accepts 2 arguments. if ( (crypt(str $user_input, $password_hash) == $password_hash) { ....... echo("Password Verified"); } You can go to this link for a better understanding! (Or refer to login.php in public directory of pset7) php.net/manual/en/function.crypt.php


1

if (password_verify($_POST["password"], $row["hash"])) You can use this function to verify, you can see this login.php aswell.


1

Before you can add a feature to allow users to reset a forgotten password, you will need to add a simpler feature: create a Controller and View that will allow an authenticated user (already logged in) to change their password to a new one -- perhaps only after entering their current, valid password. Once you have done that, you can use a similar mechanism ...


1

From php manual password_hash() creates a new password hash using a strong one-way hashing algorithm. one-way being the operative. More info on cryptographic hashing here. Or check out any of the other 2 million+ hits from Google for "one way hash". As a user I wouldn't be happy to see a password sent via email in plaintext!


Only top voted, non community-wiki answers of a minimum length are eligible