将会话变量传递给PHP中的多个页面

时间:2017-12-16 18:22:06

标签: php session

我使用这个简单的登录脚本制作一个简单的面板: https://github.com/panique/php-login-minimal

我的问题是我无法将$ _SESSION变量传递给更多的那一页。我希望用户看到更多的那一页。

这是我的代码的一部分:

 // ... ask if we are logged in here:
if ($login->isUserLoggedIn() == true) {
    // the user is logged in. you can do whatever you want here.
    // for demonstration purposes, we simply show the "you are logged in" view.
    include("views/logged_in.php");
} else {
    // the user is not logged in. you can do whatever you want here.
    // for demonstration purposes, we simply show the "you are not logged in" view.
    include("views/not_logged_in.php");
}

即使我包含 example.php ,它仍然无效。

0 个答案:

没有答案