HTML and CSS Reference
In-Depth Information
Below the app constants, you can now set up the session, include the configuration variables, set the appropriate
level of error reporting for the app, and set the app time zone. Add the code shown in bold to index.php :
<?php
/**
* The initialization script for the app
*
* @author Jason Lengstorf <jason@lengstorf.com>
* @author Phil Leggetter <phil@leggetter.co.uk>
*/
//-----------------------------------------------------------------------------
// Initializes environment variables
//-----------------------------------------------------------------------------
// Server path to this app (i.e. /var/www/vhosts/realtime/httpdocs/realtime)
define('APP_PATH', dirname(__FILE__));
// App folder, relative from web root (i.e. /realtime)
define('APP_FOLDER', dirname($_SERVER['SCRIPT_NAME']));
// URL path to the app (i.e. http://example.org/realtime )
define(
'APP_URI',
remove_unwanted_slashes('http://' . $_SERVER['SERVER_NAME'] . APP_FOLDER)
);
// Server path to the system folder (for includes)
define('SYS_PATH', APP_PATH . '/system');
// Relative path to the form processing script (i.e. /realtime/process.php)
define('FORM_ACTION', remove_unwanted_slashes(APP_FOLDER . '/process.php'));
//-----------------------------------------------------------------------------
// Initializes the app
//-----------------------------------------------------------------------------
// Starts the session
if (!isset($_SESSION)) {
session_start();
}
// Loads the configuration variables
require_once SYS_PATH . '/config/config.inc.php';
// Turns on error reporting if in debug mode
if (DEBUG===TRUE) {
ini_set('display_errors', 1);
error_reporting(E_ALL^E_STRICT);
 
Search WWH ::




Custom Search