function protectPage() { if (!isset($_SESSION['userId']) or !isset($_SESSION['userName'])) { getOut(); } elseif (!validateUser($_SESSION['userLogin'], $_SESSION['userPassword'])) { getOut(); } }
<?php require_once 'includes/class/class.Security.php'; getOut();
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <?php // put your code here session_start(); include_once './header.php'; include './functions.php'; if (!getOut()) { die('Access is not Allowed'); } ?> <h1>Admin Page</h1> </body> </html>