$_SESSION['go_to'] = $_SERVER["HTTP_REFERER"];
$go_to = $_SESSION['go_to'];
$url = explode("/", $go_to);
$lurl = "/".$url[3]."/".$url[4]."/".$url[5]."/".$url[6];
This gives the last url, if it does exist. For example if the person tries to login from the forums it give sthe address /forums/id_of forum/ and when the person logs in the header() sends it back to them.
header("location: ".$lurl."");
It works great if you are logging in from the forums, however if you are logging in from index.php then i get the following popup error from firefox.
"redirection limit for this url exceeded. unable to load the requested page, this may be caused by cookies that are blocked.
Thank you all
P.S at least i'm writing my own stuff now and having probs vs always asking how to write
- Anthony