forked from Atheos/Atheos
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patherror.php
More file actions
84 lines (69 loc) · 2.7 KB
/
error.php
File metadata and controls
84 lines (69 loc) · 2.7 KB
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
<?php
$status = $_SERVER["REDIRECT_STATUS"];
$codes = array(
400 => array("400 Bad Request", "The request cannot be fulfilled due to bad syntax."),
401 => array("401 Login Error", "It appears that the username/password was incorrect."),
403 => array("403 Forbidden", "The server has refused to fulfill your request."),
404 => array("404 Not Found", "The document requested was not found on this server."),
405 => array("405 Method Not Allowed", "The method specified in the Request-Line is not allowed for the specified resource."),
408 => array("408 Request Timeout", "Client browser failed to send a request in the time allowed by the server."),
414 => array("414 URL Too Long", "The URL you entered is longer than the maximum length."),
500 => array("500 Internal Server Error", "The request was unsuccessful due to an unexpected condition encountered by the server."),
502 => array("502 Bad Gateway", "The server received an invalid response from the upstream server while trying to fulfill the request."),
504 => array("504 Gateway Timeout", "The upstream server failed to send a request in the time allowed by the server."),
);
$title = $codes[$status][0];
$message = $codes[$status][1];
if ($_SERVER["REQUEST_METHOD"] === "POST") {
die(json_encode(array(
"status" => $title,
"text" => $message
)));
}
?>
<!DOCTYPE html>
<html lang="en">
<!-- Copyright (C) 2020-Present Liam Siira <Liam@Siira.io> -->
<!-- This file is part of the Atheos include -->
<!-- This code can not be copied and/or distributed -->
<!-- without the express permission of Liam Siira -->
<head>
<meta charset="utf-8">
<title><?php echo $title; ?></title>
<meta name="author" content="Liam Siira">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A Web-Based IDE with a small footprint and minimal requirements">
<!-- FONTS -->
<link rel="stylesheet" href="/fonts/file-icons/webfont.min.css">
<link rel="stylesheet" href="/fonts/fontawesome/webfont.css">
<link rel="stylesheet" href="/fonts/ubuntu/webfont.css">
<!-- FAVICONS -->
<?php require_once("templates/favicons.php"); ?>
<!-- THEME -->
<link rel="stylesheet" href="/theme/main.min.css">
<style>
p {
font-family: "UBUNTU-FIRA";
font-size: 1.5rem;
}
</style>
</head>
<body>
<canvas id="myth"></canvas>
<?php require_once("templates/logo.php"); ?>
<form id="error">
<fieldset>
<legend><?php echo $title; ?></legend>
<p class="center">
<?php echo $message; ?>
</p>
</fieldset>
</form>
<script type="text/javascript" src="/libraries/myth.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
Myth.init();
});
</script>
</body>
</html>