Пример #1
0
/*this is the section that will be run when any request comes to the server
it will read the request send the proper page info
if there no request it will just send the home page */
include "crt_functions.php";
function class_autoloader($class)
{
    include 'class/' . $class . '.php';
}
spl_autoload_register('class_autoloader');
date_default_timezone_set("America/Denver");
/* this will create and request object that will hold 
info used in the rest of the site */
$request_obj = new RequestObject();
$jwt_signature = new JwtSignature($request_obj->enc_key);
$request_obj->checkCookie($jwt_signature);
//fallowing will list navigation bar links displayed depends on loged and valid
if ($request_obj->valid_user) {
    $nav_display = 'style="display:inline"';
} else {
    $nav_display = 'style="display:none"';
}
if (isset($_REQUEST['request'])) {
    $request_obj->read_url($_REQUEST['request']);
    $request_obj->checkSyncToken();
    //print_r($request_obj);
    switch ($request_obj->end_point) {
        case "home":
            $main_pannel = "htmlfrag/home.php";
            break;
        case "about":