base_url turns up twice after redirect - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: base_url turns up twice after redirect (/showthread.php?tid=21401) |
base_url turns up twice after redirect - El Forum - 08-09-2009 [eluser]cybercy[/eluser] hi. i use DX_Auth for login in my application, and after logging in, i want to take the user back to the page where he came from. Please note that I use a lightbox login window. It works fine, but after the redirect, the URL is incorrect, it shows my base_url and then the full path of the referrer. Like this: http://localhost/production/http://localhost/production/main/location/9 The controller: Code: function login() What do i do wrong? Please help! Thanks base_url turns up twice after redirect - El Forum - 08-09-2009 [eluser]designfellow[/eluser] Hi, you can set a session variable before redirecting to login. $this->session->set_userdata('referring_page',uri_string()); after successfully logged in u can simply redirect like this. redirect($this->session->userdata('referring_page') ); Happy Coding, DesignFellow base_url turns up twice after redirect - El Forum - 08-09-2009 [eluser]cybercy[/eluser] Thanks!!!!! You cannot imagine how many hours I was playing around with this, and with your hint, it works. thanks again. |