-
Notifications
You must be signed in to change notification settings - Fork 23
/
404.php
55 lines (51 loc) · 1.19 KB
/
404.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
<?php
require_once('Code.class.php');
require_once('secure.inc.php');
$error = '404 Not Found';
if (isset($code)) {
switch ($code) {
case Code::RECORD_NOT_EXIST:
header('HTTP/1.1 404 Not Found');
break;
case Code::RECORD_DISABLED:
header('HTTP/1.1 403 Forbidden');
break;
case Code::RECORD_REMOVED:
header('HTTP/1.1 404 Not Found');
break;
case Code::RECORD_NOT_IN_VALID_TIME:
header('HTTP/1.1 403 Forbidden');
break;
case Code::RECORD_PAUSED:
header('HTTP/1.1 403 Forbidden');
break;
case Code::TOO_FAST:
header('HTTP/1.1 429 Too Many Requests');
break;
default:
header('HTTP/1.1 520 Unknown Error');
break;
}
$error = Code::getErrorMsg($code);
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<?php require_once('head.php'); ?>
<title>错误页 | 短网址生成器</title>
</head>
<body>
<div class="wrapper">
<?php require_once('header.php'); ?>
<div class="container">
<div class="container">
<h2 style="text-align: center"><?= $error ?></h2>
</div>
</div> <!-- /container -->
<!--This div exists to avoid footer from covering main body-->
<div class="push"></div>
</div>
<?php require_once('footer.php'); ?>
</body>
</html>