When a user logs in they get sent to the main index page, I wanted to return them to whichever page they had logged in from, so I tried using
$refer = getenv("HTTP_REFERER");
and then using header() to send them there, but because the login page sends the information to itself to authenticate (against mysql db) the $refer value is that of the login page and so it sends them there, what I need is a way to get the next to last referer, which will send them to the correct page.
Is there a function for this, or another way
around this problem?
Thanks for any help