redirect in codeigniter
$this->load->helper('url');
redirect('controller/method', 'refresh');
Explanation:
- $this->load->helper('url');
loads the URL Helper which provides functions to help with creating links and redirection.
- redirect('controller/method', 'refresh');
redirects the user to the specified controller/method. The 'refresh' parameter is used to send an HTTP refresh header to the browser, ensuring that the correct redirect status is sent.