CodeIgniter Forums
redirect to previous url - 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: redirect to previous url (/showthread.php?tid=15656)



redirect to previous url - El Forum - 02-10-2009

[eluser]nuttynibbles[/eluser]
hi,

as many of you have notice, if you were to go to (for e.g youtube) and you wanna post a comment, they require you to login. so you be redirected to login page and once login, they will redirect you back to the same page where you wanted to comment..

if im not wrong, we can use HTTP_REFERER to get previous url and save it into session??. but is there a better way??


redirect to previous url - El Forum - 02-11-2009

[eluser]TheFuzzy0ne[/eluser]
Usually, the URI to the current page can be stored as a hidden variable within your form. When the form is submitted, the return URI can be obtained easily.

Hope this helps.


redirect to previous url - El Forum - 02-12-2009

[eluser]nuttynibbles[/eluser]
im thinking of storing it into the url. i tried changinge $config['enable_query_strings'] = TRUE; but it wont work if i type the url as http://example.com/login.php?url=

it will give a 404 error


redirect to previous url - El Forum - 02-12-2009

[eluser]helmutbjorg[/eluser]
Already discussed at: http://ellislab.com/forums/viewthread/105291/