-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.php
169 lines (141 loc) · 4.33 KB
/
error.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php ob_start(); ?>
<?php
if(isset($_GET['e'])){
$error_type = $_GET['e'];
switch($error_type){
case 404 : $e_msg = "404 Resource Not Found";
$s_status = "200";
$e_content_pOne = "Recource you've requested is not found.";
$e_content_pTwo = "You will be redirected back to home page now...";
break;
case 500 : $e_msg = "500 Internal Server Error";
$s_status = "500";
$e_content_pOne = "We are currently experiencing a server error.";
$e_content_pTwo = "We are right on it, We'll be back in no time...";
break;
default : $e_msg = "400 Bad Request";
$s_status = "200";
$e_content_pOne = "Recource you've requested cannot be located.";
$e_content_pTwo = "You will be redirected back to home page now...";
break;
}
}else{
$error_type = 400;
$e_msg = "400 Bad Request";
$s_status = "200";
$e_content_pOne = "Recource you've requested cannot be located.";
$e_content_pTwo = "You will be redirected back to home page now...";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Error</title>
<link rel="stylesheet" type="text/css" href="public/css/error.css">
</head>
<body oncontextmenu="return false;">
<div id="particles-js"></div>
<div class="terminal-window">
<header>
<div class="button green"></div>
<div class="button yellow"></div>
<div class="button red"></div>
</header>
<section class="terminal">
<div class="history"></div>
$ <span class="prompt"></span>
<span class="typed-cursor"></span>
</section>
</div>
</div>
<script type="text/javascript" src="public/js/jquery.min.js"></script>
<script type="text/javascript" src="public/js/typed.custom.js"></script>
<script type="text/javascript" src="public/js/menu-override.js"></script>
<script>
$(function() {
var data = [
{
action: 'type',
strings: ["Accessing restricted files.."],
output: 'grabbing files..<br><br>',
postDelay: 1000
},
{
action: 'type',
strings: ["<?php echo $e_msg; ?>"],
output: '<span class="gray">iHeartCoding | Sever Staus : <?php echo $s_status; ?> </span><br> ',
postDelay: 1000
},
{
action: 'type',
strings: ["<?php echo $e_content_pOne; ?>", "<?php echo $e_content_pTwo; ?>"],
postDelay: 2000
}
];
runScripts(data, 0);
});
function runScripts(data, pos) {
var prompt = $('.prompt'),
script = data[pos];
if(script.clear === true) {
$('.history').html('');
}
switch(script.action) {
case 'type':
// cleanup for next execution
prompt.removeData();
$('.typed-cursor').text('');
prompt.typed({
strings: script.strings,
typeSpeed: 30,
callback: function() {
var history = $('.history').html();
history = history ? [history] : [];
history.push('$ ' + prompt.text());
if(script.output) {
history.push(script.output);
prompt.html('');
$('.history').html(history.join('<br>'));
}
// scroll to bottom of screen
$('section.terminal').scrollTop($('section.terminal').height());
// Run next script
pos++;
if(pos < data.length) {
setTimeout(function() {
runScripts(data, pos);
}, script.postDelay || 1000);
}
}
});
break;
case 'view':
break;
}
<?php
switch($error_type){
case 404 :
echo "setTimeout(function() {
window.location.href = '/';
}, 15000);";
break;
case 400 :
echo "setTimeout(function() {
window.location.href = '/';
}, 15000);";
break;
case 500 : break;
default :
echo "setTimeout(function() {
window.location.href = '/';
}, 15000);";
break;
}
?>
}
</script>
</body>
</html>