Welcome Guest, Not a member yet? Register   Sign In
decode() returning FALSE value
#1

[eluser]Unknown[/eluser]
hello,
in my authentication() i was trying to decode my stored password and compare it with user entered password to start his session. for that i am using $this->encrypt->decode() but its returning me false as boolean type value (i debug it using codelobster) instead of decrypted value. i have included encryption library in model's index() also

Code:
//model code
if($query->num_rows()==1)
{
$data=$query->row_array();
$np=array();
$np=$this->input->post('NewUserPass');// user entered password
$pword=array();
$pword=$data['Password']; // password fetched from db
$npword=$this->encrypt->decode($pword);
if($npword===$np)
{
              //my logic
        }
        else
         {
              //my logic
         }
}


also i tried to encode user entered password and compare it with stored encrypted password but new encoded string is different than the stored string(hash).

so which way would be better to do?
can any one figure out problem.




Theme © iAndrew 2016 - Forum software by © MyBB