Welcome Guest, Not a member yet? Register   Sign In
password_hash returning empty password in database
#1

Hello, thank you for viewing my question. I tried to do hashing for my registration. This is my code for password hashing.

PHP Code:
if(isset($data['data']['password']))
        {
            $data['data']['password'] = password_hash($data['data']['password'], PASSWORD_DEFAULT);
      
            
unset($data['data']['password']);
        }

        return $data


I seriously don't know what I did wrong. I tried to unset by following this (https://forum.codeigniter.com/post-376484.html), 
the password_verify() will return error of :


Quote:ErrorException password_verify(): Passing null to parameter #2 ($hash) of type string is deprecated

This is the code from Login controller :

PHP Code:
if (password_verify($password$UserModel->password_hash)) {
                
                
echo "Login ok";
                
            
} else {
                
                
echo "Login not ok";
            
Reply




Theme © iAndrew 2016 - Forum software by © MyBB