• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do i redirect user to "home" controller after successfully loggin?

#1
PHP Code:
I have this method for login
public function authenticate(){
//get formm input into an array
$login_data = array(
'username' =>$this->request->getPost("username"),
'password' =>$this->request->getPost("password")
);

try{
  if($this->model_login->login($login_data)){
//redirect(base_url('home')); 
  redirect('home'); 
}else{
  $data['error'] = 'Incorrect password/username entered';
  echo view('view_login'$data);
}
}catch(\
Exception $e){
die(
$e->getMessage());
}


When the user succesfully login it throws this message "{0, string} route cannot be found while reverse-routing" instead of redirecting to "Home: controller. 
Reply


Messages In This Thread
How do i redirect user to "home" controller after successfully loggin? - by tebogosebake - 01-23-2019, 06:59 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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