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

[eluser]Unknown[/eluser]
I am implementing login functionality. for that in users database i am storing encrypted password and when user try to login i am decoding this password and carrying out comparison of strings. based on result user will be either logged in or error msg will be displayed but while decoding password from Password field decode() returning FALSE as bool value. why?
Code:
//model code to register user (here i am giving code for password only)
$this->load->library('encrypt');
$newuserdata=array();
        $p=$this->input->post('UserPass');
$enpass=$this->encrypt->encode($p);

Code:
//code for login model
        $data=$query->row_array();
$np=array();
$np=$this->input->post('NewUserPass');
$pword=array();
$pword=$data['Password']; //  $pword get the same encrypted string from Password field
$npword=$this->encrypt->decode($pword); // here decode returns false instead of decoded value for $pword

can any body help me to do this?




Theme © iAndrew 2016 - Forum software by © MyBB