-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.php
34 lines (31 loc) · 944 Bytes
/
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
<?php
$title = "{$_GET["error"]} error | Shorty";
$css_path = "./public/css/style.css";
include "./templates/header.php";
?>
<main>
<div class="form-container">
<h2><?php echo $_GET["error"]; ?> error</h2>
<?php
if (isset($_GET["error"])) {
if ($_GET["error"] == "403") {
header("HTTP/1.1 403 Forbidden");
echo "<h5>You cannot access this page</h5>";
} else if ($_GET["error"] == "404") {
header("HTTP/1.1 404 Not Found");
echo "<h5>Requested shortened link is either expired or invalid.</h5>";
} else if ($_GET["error"] == "500") {
header("HTTP/1.1 500 Internal Server Error");
echo "<h5>There was an error on server try again later.</h5>";
} else {
header("location: index.php");
}
} else {
header("location: index.php");
}
?>
</div>
</main>
<?php
include "./templates/footer.php";
?>