url 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: url redirect (/showthread.php?tid=53956) |
url redirect - El Forum - 08-16-2012 [eluser]Unknown[/eluser] how to do these effect in codeigniter : To visit url: /a/b , but must login in correctly. if not, redirect to /login/index . then logining, if correctly login. redirect to url /a/b again. I tried many times, use rawurlencode() to let /a/b as part of request url , but show not found page. would you please give me one idea? thanks. url redirect - El Forum - 08-16-2012 [eluser]Otemu[/eluser] There a number of techniques you could use: 1. Store previous page using get or post 2. using session to store previous page 3. using $_SERVER['HTTP_REFERER'] to get the previous page Check out a solution here url redirect - El Forum - 08-16-2012 [eluser]Unknown[/eluser] thanks your reply. Ye , i get the idea. but about 1 and 3 point . i can not understand clearly. My question's key is how to redirect back to the page before logining, it's url is Dynamic. such as domain/a/b or domain/b/c/d ... i can not transfer the url of before page as a request querystring . even though using rawurlencode(): Code: $preurl = $this->uri->uri_string(); after check, location is such as: HTTP://".$_SERVER["HTTP_HOST"]."/login/index/a/b why rawurlencode() no effect?? |