- ./
- ./images
- ./includes/common
- ./includes/config
- ./includes/functions
- ./javascript
- ./styles
- ./templates/borrower
- ./templates/main
- ./templates/manage
- ./templates/search
./includes/common/common.php
<?php
date_default_timezone_set("Europe/London");
error_reporting(0);
//start the session
session_start() or report ('Cannot start session', '', '');
//set the required headers
header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );
//some included files require site inclusion verification so difine insite as true
define('IN_SITE', true);
//Include the debug common file
include($dir_path.'includes/common/debug.php');
//Grab session vars without screwing them up (copy the array)
foreach($_SESSION as $name => $value)
{
$new_ses[$name] = $value;
}
//put together a var for use by the error log later on if it is called (when errors occur)
$stats = (array("get" => $_GET, "post" => $_POST, "session" => $new_ses, "cookie" => $_COOKIE, "server" => $_SERVER));
//Load up the config vars
include($dir_path.'includes/config/sql.php');
//establish a database connection
$connection = mysql_connect($CONFIG['host'], $CONFIG['user'], $CONFIG['password']) or report ("Unable to connect to SQL Server", mysql_error());
$db = mysql_select_db($CONFIG['database'],$connection) or report ("Unable to select the SQL database", mysql_error());
//include all of the function files
include($dir_path.'includes/functions/user.php');
include($dir_path.'includes/functions/form.php');
include($dir_path.'includes/functions/layout.php');
//Include the rest of the common functions
include($dir_path.'includes/common/auth.php');
//prevent sql injection for get and post vars
foreach ($_POST as $name => $value)
{
$_POST[$name] = quote_smart($value);
}
foreach ($_GET as $name => $value)
{
$_GET[$name] = quote_smart($value);
}
$layout = new Layout();
$layout->startLayout();