PHP 5.5 Password Hashing not working
I have followed this site to use a password hashing. Using simple test data - password = "mypw". I have saved the password hash as "$2y$10$PeQGxwKQVq70fwPtznH70.fJER/BVYB7u5xl0E" yet when I use
Code:
password_verify($password, $hash) Here is the entire code... Insert code... Code:
$hash = password_hash($password, PASSWORD_DEFAULT); Code:
$sql = "SELECT * FROM `users` WHERE `username` = '$username'"; |
$dbhash = $rst-> password;
I recommend to remove the space before passsword. What do the echo statements give out? |
|
The password $hash in the db is good. It returns..."$2y$10$PeQGxwKQVq70fwPtznH70.fJER/BVYB7u5xl0E". Trim also did not help and I removed the " " before the password field.
|
Your code works for me on a two column database:
Code:
mysql> describe users; Code:
$ php -v Code:
<?php |
All times are GMT -5. The time now is 06:19 AM. |