Hmm, lately I've coded all kinds of new and neat stuff (for my skill level, anyhow) but decided to scream "help" on this one.
What are the best methods for remembering the "Ref Page" when sending the surfer to a login script? (You want him to return to the page he attempted to enter when unauthorized...) I've basically been doing a cookie based authentication....
I was sure I was onto something with this in the header:
if (($Members="1") && ($AuthState="0")) {
setcookie("RefPage", "$_SERVER[PHP_SELF]");
header("Location: login.php");
}
and then in login.php, once the password check is finished:
$RefPg="$_COOKIE[RefPg];
echo "Welcome! Click <a href=\"$RefPg">here</a> to enter the site!";
but what I'm getting is a link to http://mysite.com/A
As if I were putting in an "Array" value somewhere, and the browser couldn't handle it...any wisdom? How do you accomplish this feat?
TIA