我已经开始在我的网站中实现此登录脚本Github Link但是遇到了运行主要问题,这是一个普通的PHP问题,无论脚本如何。登录并重定向后,它只允许访问单个页面而不是整个目录或其他php页面。
Index.php在这里:
<?php
/**
* @package SimplePHPLogin
*/
/**
* include the configs / constants for the database connection
*/
require_once("config/db.php");
// Loads all the Classes needed by the Login Script as needed
function autoload($class)
{
require('classes/' . $class . '.class.php');
}
// automatically loads classes when needed
spl_autoload_register("autoload");
//create a database connection
$db = new Database();
// start this baby and give it the database connection
$login = new Login($db);
// base structure
if ($login->displayRegisterPage()) {
include("views/login/register.php");
} else {
// are we logged in ?
if ($login->isUserLoggedIn()) {
include("smartportal/main.php");
// further stuff here
} else {
// not logged in, showing the login form
include("views/login/not_logged_in.php");
}
}
我正在跳跃,有人可能会