Welcome Guest, Not a member yet? Register   Sign In
hashing password and decrypting(need hlp)
#6

(06-06-2018, 12:54 PM)it still didn\t work out.i just don't know what i'm doing wrong here. Wrote: @InsiteFX and @qury
He wants to verify it and login a person. Not decrypt the password; It's just a bad choice of words.

PHP Code:
public function login_model($email,$password)
 
 {
 
  
      $this
->db->select('*');
 
     $this->db->from('users');
 
     $this->db->where('Email',$email);
 
     $this->db->where('Role_Id !=',1);
 
     $query $this->db->get();

 
     if($query->num_rows() === 1)
 
     {
 
         // storing the results in the variable $data
 
         $data $query->row(); 

 
           if($this->verifyHash($password,$data->password) === TRUE)
 
           {
 
               $dat = array(
                 
  'id_user' => $data->id_User,
                 
  'FirstName' => $data->FirstName,
                 
  'LastName' => $data->LastName,
                 
  'Phonenumber' => $data->PhoneNo                 
                   
'Email' => $data->Email,
                 
  'role' => $data->Role_Id,
                 
  'imageUrl' => $data->imageUrl,
                 
  'category_id' => $data->category_id,
                 
  'IdType' => $data->IdType,
                 
  'IdNumber' => $data->IdNumber,
                 
  'DOB' => $data->DOB,
                 
  'confirmCode' => $data->confirmCode,
                 
  'confirmed' => $data->confirmed,
                 
  'Points'=> $data->Points                  
                
);
 
           }
 
          
            $this
->session->set_userdata($dat); 
 
           return true    
      
}
 
     else{
 
         return false;
 
      }
 
     
  

Reply


Messages In This Thread
RE: hashing password and decrypting(need hlp) - by douluv4u - 06-07-2018, 03:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB