• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
redirect to previous url


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??

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.

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

Already discussed at: http://ellislab.com/forums/viewthread/105291/

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.