In Codeigniter redirect another URL use redirect(). Redirect next page or other URL is very easy in Codeigniter.
Here I will put example code that code is work after logout from a web page.
if($logout_success){
redirect(‘login’);
}
If you want to redirect from previous page after login or logout then you need to follow this example code.
if($qry){
redirect($_SERVER[’HTTP_REFERER’]);
}
Hope it will be helpful for you. comment me for more.
Question and answer is powered by AnsPress.io