-
Notifications
You must be signed in to change notification settings - Fork 1
/
error.php
65 lines (64 loc) · 2.69 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
<?php
@ob_start();
session_start();
date_default_timezone_set('Asia/Singapore');
?>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<link rel="icon" href="img\studylah_logo.jpg" type="image/jpg">
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500&display=swap" rel="stylesheet">
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<link rel="stylesheet" href="css\error.css">
<title>StudyLah</title>
</head>
<body>
<div class="bg">
<div class="centered">
<?php
if ($_SERVER['SERVER_PORT'] == '80' || $_SERVER['SERVER_PORT'] =='443'){
echo "<div onclick=\"window.location.href='http://localhost/orbital/signup.php'\" id=\"closebutton\" class=\"close\">×</div>";
}
else{
echo "<div onclick=\"window.location.href='http://localhost:8080/orbital/signup.php'\" id=\"closebutton\" class=\"close\">×</div>";
}
?>
<div class="inline">
<img src="img/close.png" width="50px" height="50px" alt="error img">
</div>
<div class="inline">
<div>
<h2>Error!</h2>
</div>
<?php
$fetcherrortype=$_GET['error'];
if($fetcherrortype=='invalidtoken'){
echo "<div>Your token is invalid :(</div>";
}
else if($fetcherrortype=='accountexist'){
echo "<div>Account already exists!</div>";
}
else if($fetcherrortype == 'unauthorizedgroup'){
echo "<div>You are unauthorized to view this group message!</div>";
}
else if($fetcherrortype == 'usernotfound'){
echo "<div>User not found :(!</div>";
}
else if($fetcherrortype == 'forumdoesnotexist'){
echo "<div>Forum not found :(!</div>";
}
else{//general error
if ($_SERVER['SERVER_PORT'] == '80' || $_SERVER['SERVER_PORT'] =='443'){
echo "<div>Oops, there seems to be an error! <br>Go back <a href='http://localhost/orbital/signup.php'>here.</a></div>";
}
else{
echo "<div>Oops, there seems to be an error! <br>Go back <a href='http://localhost:8080/orbital/signup.php'>here.</a></div>";
}
}
?>
</div>
</div>
</div>
</body>
</html>