Return to Snippet

Revision: 6427
at May 20, 2008 17:43 by mattkenefick


Initial Code
<?php
/**************************************
 seesaw associates | http://seesaw.net

 client: 		
 file: 		index.php
 description: 	main handler

 Copyright (C) 2008 Matt Kenefick(.com)
**************************************/


###################
## BASIC CONFIGS ##
###################

	//start session
	session_set_cookie_params(86400);
	session_cache_expire(1140); // 24 hours
	session_name("Client");
	session_start();
	
	set_magic_quotes_runtime(0); 
	
	error_reporting(E_ALL);
	
	// turn of pages cache
	header("Cache-control: private, no-cache");
	header("Expires: Mon, 26 Jun 1997 05:00:00 GMT");
	header("Pragma: no-cache");
	header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
	header("Content-Type: text/html");

	// main configuration
	require_once("includes/functions.php");
	
	// load mysql etc libraries
	require_once("includes/classes/class.mysql.php");
	require_once("smarty/Smarty.class.php");
			
	
###################################
## CREATE MYSQL CONN / VALIDATOR ##
###################################

	$db = new DB;
	$db->init('localhost', 'user', 'pass', 'database');
	$db->settings('fixSlashes',true);
	
	
# CHECK SESSIONS / SETTINGS

	require_once("includes/settings.php");
	

########################
## CHECK CURRENT PAGE ##
########################

	$smarty = new Smarty;
	
	$smarty->template_dir 	= 	"./includes/skin/";
	$smarty->compile_dir	=	"./includes/skincache/";
	$smarty->debugging = false;
	$smarty->use_sub_dirs = false;
	
	// get page
	$p = isset($_REQUEST['p'])?$_REQUEST['p']:'home';
		
	// get support	
	if( file_exists('includes/public/page.'.$p.'.php') ) 
			require_once('includes/public/page.'.$p.'.php');
	
	$smarty->display('index.html');
	
	$db->done();
	session_write_close();
			
?>

Initial URL


Initial Description


Initial Title
PHP: Typical Index Page

Initial Tags


Initial Language
PHP