I am trying to build a form with a password input.
I am trying to hash the password via php password_hash
and save it in the DB.
And when the users logs in, i will hash his input and check if its the same like in the DB.
The Problem is that when I use password_hash it gives me a random output everytime I refresh. The input is still the same. That makes it impossible for the user to log in because the outputhash will never match whats in the DB.
I am testing it like that:
$pw = "hello";
echo password_hash ($pw, PASSWORD_DEFAULT);
the first echo = $2y$10$7GwPLFNIhybl6tcyuYsH..Dtgfn2hF7RUDwZ99o7BkL6eza4Dsope;
echo again = $2y$10$7tvaZHupw8Ik8Id/ImHCHekpp/Deg4E.XkG82zaVYx262Exv3zMde;
Am I doing smt wrong? plz help