01-23-2019, 06:59 AM
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.