我有一个包含三个链接的索引页面,如下所示。当我单击第一个链接(下例中的 pageType1)时,将运行 pageType1.php,首先检查用户是否通过 cookie 登录。如果不是,则将用户重定向到登录页面。当用户在登录页面上正确提交登录名和密码信息时,我想在 pageType1.php 上显示信息
文件:index.php
<a href="pageType1.php" target="_blank">PageType1</a>
<a href="pageType2.php" target="_blank">PageType2</a>
<a href="pageType3.php" target="_blank">PageType3</a>
文件:pageType1.php
<?php
include"auth/auth_check_header.php";
print("pageType1 contents");
?>
文件:pageType2.php
<?php
include"auth/auth_check_header.php";
print("pageType2 contents");
?>
文件:pageType3.php
<?php
include"auth/auth_check_header.php";
print("pageType3 contents");
?>
文件:auth/auth_check_header.php
$successful_login_url = ?????? //How to track this value.
if (!cookie_enabled)
{
//login page
header("location:$successful_login_url");
}
我的问题是如何在 auth/auth_check_header.php 中跟踪“$successful_login_url”值(或者我应该把这个变量的值作为什么)
注意:我尝试将 $_SESSION["referer"] 作为 "$successful_login_url" 的值,但成功登录后显示 index.php。提前致谢