<?php
include('include/autoloader.php');
// recieve the page id and slug variables
$id = intval(make_safe(xss_clean($_GET['id'])));
$slug = make_safe(xss_clean($_GET['slug']));
$page = $general->page($id);
// check if the page exists, if not redirect to error page 
if ($page == 0) {
header('Location:'.$options['general_siteurl'].'/not-found');	
}
// fetching the result
foreach ($page AS $key=>$value) {
$smarty->assign('page_'.$key,$value);	
}
// assign the SEO variables (title,keywords,description).	
$smarty->assign('seo_title',htmlspecialchars_decode($page['title'],ENT_QUOTES));	
$smarty->assign('seo_keywords',$page['seo_keywords']);
$smarty->assign('seo_description',$page['seo_description']);
// display the page HTML 
$smarty->display('page.html');
?>