<?php
spl_autoload_register(function ($class) {
    include $_SERVER['DOCUMENT_ROOT'] . '/odensetrack/classes/' . strtolower($class). '.class.php';
});

if (Config::$closed == true) { die("Access to this site is closed."); } // If site is set to closed, deny all access.

if (Config::$debug == true) { // If debugging is enabled, lets print some PHP errors if any.
    error_reporting(-1);
    ini_set('display_errors', 'On');
} else {
    ini_set('display_errors', 'Off');
}

// Below here we do some basic SQL injection. Remember to sanitize inputs everywhere. This is VERY basic!

// Using new DB class
$db = new dbClass();
foreach ($_POST as $key => $value)
    $_POST[$key] = $db->escapeString($value);

foreach ($_GET as $key => $value)
    $_GET[$key] = $db->escapeString($value);

