= $redirectDatetime) { header("Location: http://campaign.esdlife.com/2/king-yat-hin/2019/03/open-day/"); die(); } include_once("_inc/config.inc.php"); // Check HTTPS /*$request_header = getallheaders(); if ($request_header['X-Forwarded-Proto'] != 'https') { header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); }*/ // URL Validation if(!file_exists($content_template)) { header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", true, 404); include_once(TEMPLATE_PATH."404.php"); exit(); } // Set Page Base Temaplate If Not Defined if(!file_exists($page_template)) { $page_template = TEMPLATE_PATH."page_index.tpl.php"; } // Set OG Information If Not Defined if(!$page_config['FB_OG'][$page_section]) { $page_config['FB_OG'][$page_section] = $page_config['FB_OG']['index']; } // Set Section Template $section[$page_section] = array( 'template' => $content_template, ); // Set Section Variables if($page_section == 'form') { $section[$page_section]['var'] = array( 'page_activate' => APP_ACTIVATE, 'owner' => $companyName, ); } // Set Page Variables $var['og'] = $page_config['FB_OG'][$page_section]; $var['info'] = array( 'company' => $companyName, 'campaign' => $campaignName, 'url' => CAMPAIGN_PATH, ); $var['html'] = array( 'footer' => $footer_template, 'modal' => $modal_template, 'noscript' => $noscript_template, 'script' => $script_template, 'sections' => $content_template, 'terms' => $terms_template, ); $var['app'] = array( 'activate' => APP_ACTIVATE, 'debug' => $debug, 'theme_color' => $theme_color, ); // Define Page Object $page = new Template($page_template); $page->var = $var; // Display Page ob_start(); $page->display(); ob_end_flush(); ?>