-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
72 lines (63 loc) · 1.51 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<style>
body {
background-color: #141414;
color: #fff;
font-family: 'Roboto', sans-serif;
text-align: center;
}
h1 {
font-size: 36px;
margin-top: 50px;
}
p {
font-size: 18px;
}
form {
margin-top: 50px;
}
input[type="submit"] {
background-color: #0066ff;
border: none;
color: #fff;
cursor: pointer;
font-size: 18px;
padding: 10px 20px;
transition: background-color 0.3s ease;
}
input[type="submit"]:hover {
background-color: #0047b3;
}
#result {
margin-top: 20px;
}
</style>
</head>
<body>
<h1>Welcome to this Webpage</h1>
<p>To continue using, please verify yourself below</p>
<form action="/login" method="POST" enctype="multipart/form-data">
<input type="submit" value="Login">
</form>
<p id="result"></p>
</body>
</html>
<script>
document.querySelector('form').addEventListener('submit', function(event) {
event.preventDefault(); // Prevent form submission
// Make an asynchronous POST request to the server
fetch('/login', { method: 'POST' })
.then(response => response.text())
.then(result => {
document.getElementById('result').textContent = result;
})
.catch(error => {
console.error('Error:', error);
});
});
</script>
</body>
</html>