Abandon project from the old CTHN era.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

16 lines
486 B

<?php
function active_page() {
if (!empty($_GET['page'])) return trim(preg_replace('/[^a-zA-Z0-9\/-_]+/', '', $_GET['page']));
return 'mainpage';
}
function content($name) {
$filename = "public_html/pages/{$name}";
$ext = file_exists("{$filename}.html.php") ? 'html.php' : 'html';
if (!file_exists("{$filename}.{$ext}")) include('public_html/pages/error_404.html');
include("{$filename}.{$ext}");
}
// Go for it!
include('public_html/pages/layout.html.php');