Пример #1
0
function protectPage()
{
    if (!isset($_SESSION['userId']) or !isset($_SESSION['userName'])) {
        getOut();
    } elseif (!validateUser($_SESSION['userLogin'], $_SESSION['userPassword'])) {
        getOut();
    }
}
Пример #2
0
<?php

require_once 'includes/class/class.Security.php';
getOut();
Пример #3
0
<!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>