<?php
/************************************
* Cadence
* Remotely Hosted Guestbook Script.
* (c) 2006, Dennis Pedrie
* www.CadenceBook.com
* index.php
***********************************
* Cadence Guestbook is licensed under
* a Creative Commons License.
* More information is available by visiting
* http://creativecommons.org/licenses/by/3.0/
* or the LICENSE file in the Cadence Root Folder
***********************************/
// CREATE RANDOM HASH: strlen(md5(time() . "hide@address.com" . md5($password)));
//Short and Sweet. :D
error_reporting(E_ERROR|E_WARNING|E_PARSE);
// Load the script.
include "init.php";
// Create an array of available pages.
$pages = array(
'idx', 'approve',
'add', 'addcomplete',
'help', 'login',
'admin');
// Check that the page is valid
if(!in_array($act, $pages) OR !isset($act) OR empty($act)) {
$act = "idx";
}
if(strpos($_SERVER['REQUEST_URI'], "index.php") > 0 && $act == "idx" && $CONFIG['use_rewrite']) {
header("location: ". $CONFIG['url'] ."book/". $_GET['book'] ."/");
}
// Check that file exists, and include it.
$file = "sources/". $act .".php";
if(file_exists($file)) {
include $file;
}
else {
trigger_error("Source File Does Not Exist",E_USER_ERROR);
}
?>