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 :
* The initialization script for the app
* @author Jason Lengstorf <>
* @author Phil Leggetter <>
// 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. )
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)) {
// Loads the configuration variables
require_once SYS_PATH . '/config/';
// Turns on error reporting if in debug mode
if (DEBUG===TRUE) {
ini_set('display_errors', 1);
Search WWH ::

Custom Search