Thanks for the advice, I changed my code as you suggested, but it still doesn't work.
new code:
function CheckValidUser()
{
/* see if somebody is logged in and notify them if not */
global $valid_user;
if (!$_SESSION('valid_user')) /* they are not logged in */
{
ErrorFormat();
echo "<br/>You are not logged in.<br/>";
if ($_SESSION['hist'] = $_SERVER['PHP_SELF'])
{
redirect(2, "\Index.html");
}
else
{
echo "not set";
}
//DoHtmlUrl("/Login.php", "Login");
EndFormat();
exit;
}
}
and check in the login page....
if(isset($_SESSION['hist']))
{
echo $_SESSION["hist"];
}
else
{
echo "NO LINK";
}