I know how to redirect a page using:
Code:
header("location:my_page.php");
However, I want to redirect a user back to where they came from. Basically, I have a login form on each page of my site. Once they click submit (no matter what area they are in,) they will be logged in. Instead of redirecting a page that I have set (ie. members_only.php), I want to send them back to where they came from. I know this can be done in javascript, but I don't want javascipt. Any ideas for PHP?
|