-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.html
More file actions
83 lines (78 loc) · 2.13 KB
/
error.html
File metadata and controls
83 lines (78 loc) · 2.13 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forbidden Access</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #121212;
color: #fff;
text-align: center;
padding: 50px;
}
.error-box {
background-color: #2c2c2c;
border-radius: 10px;
padding: 30px;
display: inline-block;
width: 300px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
h1 {
color: #e74c3c;
}
p {
color: #bdc3c7;
}
.ip-address {
font-weight: bold;
color: #00ff00;
}
button {
padding: 10px 20px;
background-color: #e74c3c;
border: none;
border-radius: 5px;
color: #fff;
cursor: pointer;
}
button:hover {
background-color: #c0392b;
}
</style>
</head>
<body>
<div class="error-box">
<h1>403 Forbidden</h1>
<p>You have no permission to access this resource.</p>
<p>Your IP Address: <span class="ip-address" id="ip-address"></span></p>
<button onclick="reloadLogin()">Try Again</button>
</div>
<script>
// Function to get the user's IP address
function getUserIP(callback) {
const xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.ipify.org?format=json', true);
xhr.onload = function () {
if (xhr.status === 200) {
const response = JSON.parse(xhr.responseText);
callback(response.ip);
} else {
callback('Unable to fetch IP');
}
};
xhr.send();
}
// Function to reload the login page
function reloadLogin() {
window.location.href = 'login.html';
}
// Fetch the user's IP address and display it
getUserIP(function(ip) {
document.getElementById('ip-address').textContent = ip;
});
</script>
</body>
</html>