• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Login from Outlet and Admin Table

#2
Try one of the available authentication libraries for CodeIgniter, like "Ion_auth" or "Community_auth". It will save a lot of time, and you will have better security.
Besides that, learn how to avoid repeating code.
E.g. the part where you determine if the user is a staff member or a customer can be way shorter:

PHP Code:
if ($staff->num_rows() > 0) {
 
 $data $staff->row_array();
 
 $this->session->set_userdata('login'TRUE);
 
 $this->session->set_userdata('akses',$data['level');
 
 $this->session->set_userdata('ses_id'$data['username']);
 
 $this->session->set_userdata('ses-name'$data['name']);
 
 redirect('dashboard');
}
else {
     ...

Reply


Messages In This Thread
RE: Login from Outlet and Admin Table - by Wouter60 - 06-23-2019, 01:16 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.