1//You can use redirect in codeigniter by loading helper 'url'
2$this->load->helper('url');
3
4//The redirects functions accepts two parameters to execute the function first is 'Location Url' and second parameter allows the developer to use different HTTP commands to perform the redirect "location" or "refresh".
5if (!$user_logged_in)
6{
7 redirect('/account/login', 'refresh');
8}
1This should help :
2http://www.codeigniter.com/user_guide/libraries/user_agent.html
3
4$this->load->library('user_agent');
5if ($this->agent->is_referral()){
6 echo $this->agent->referrer();
7}
8
9or straight PHP:
10
11redirect($_SERVER['HTTP_REFERER']);