Welcome Guest, Not a member yet? Register   Sign In
redirect to previous url
#1

[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??
#2

[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.
#3

[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
#4

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




Theme © iAndrew 2016 - Forum software by © MyBB