-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
52 lines (43 loc) · 1.03 KB
/
index.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
<?php
/**
* File: index.php
* Version: 0.1.3
* Description: Main entry point of the application.
*/
// Function to redirect to error.php with a unique error number
function redirectToError($errorCode) {
$errorNumber = $errorCode; // Generate a unique 4-digit error number
header("Location: error.php?error=$errorNumber");
exit;
}
// Include the core.php file
$errorCode = 1000;
if (file_exists('core.php')) {
require_once 'core.php';
} else {
redirectToError($errorCode++);
}
// Include the header.php file
if (file_exists('header.php')) {
require_once 'header.php';
} else {
$errorCode = 1001;
redirectToError($errorCode++);
}
// Include the page.php file
if (file_exists('page.php')) {
require_once 'page.php';
} else {
$errorCode = 1002;
redirectToError($errorCode++);
}
// Include the footer.php file
if (file_exists('footer.php')) {
require_once 'footer.php';
} else {
$errorCode = 1003;
redirectToError($errorCode++);
}
// Rest of your code for header, page, and footer
// ...
?>