OK, I have figured out that the getenv("SCRIPT_NAME") works for this but....
I tried to load it in a session variable to pass to the login page but the login page doesn't see the session variable.
The regular page top looks like this....
<?php
session_start();
if (@$auth != "yes")
{
session_register('RegPage');
$getnv = getenv("SCRIPT_NAME");
$_SESSION['ReqPage'] = $getnv;
header("Location: ../../login_form.php");
exit();
}
?>
The login page redirect for a successful login looks like this
header("Location: $RegPage");
why doesn't it work?