Hi,
OK, on any page, you must have a link like so (to provide access to the login page):
request.php?action=login&referrer=$PHP_SELF
On the request.php page, detect the cookie using the following script:
if (isset($cookieName)) {
LOGIN PROC
Header("Location: ".$referrer."");
} else {
CREATE PROC
Header("Location: ".$referrer."");
}
This assumes that the account creation procedure automatically sets up an account (with no personalistation, just an ID number). If you need use personalisation, such as a form, you can carry over the variable using a hidden form field to a form processing page like so:
<input type="hidden" name="referrer" value="$referrer">
Cheers,
David