-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
60 lines (51 loc) · 1.27 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
session_start();
require_once 'application/Globals.php';
require_once 'application/Extras.php';
require_once 'application/DB_Connect.php';
// Debugging status
if (DEBUG)
{
// Report all errors, warnings, interoperability and compatibility
error_reporting(E_ALL|E_STRICT);
// Show errors with output
ini_set("display_errors", "on");
}
else
{
error_reporting(0);
ini_set("display_errors", "off");
}
if( empty($_SESSION['nickname']) )
{
header("Location:expire.php");
}
/*** nullify any existing autoloads ***/
spl_autoload_register(null, false);
/*** specify extensions that may be loaded ***/
spl_autoload_extensions('.php');
/*** class Loader ***/
function classLoader($class)
{
$filename = $class . '.php';
$file ='controllers/' . $filename;
if (!file_exists($file))
{
return false;
}
include $file;
}
function classModelLoader($class)
{
$filename = $class . '.php';
$file ='models/' . $filename;
if (!file_exists($file))
{
return false;
}
include $file;
}
/*** register the loader functions ***/
spl_autoload_register('classLoader');
spl_autoload_register('classModelLoader');
?>