-
Notifications
You must be signed in to change notification settings - Fork 1
/
404.html
53 lines (48 loc) · 3.2 KB
/
404.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>EasyForm</title>
<meta name="description" content="Free, self-hosted, open-source form backend solution. No installation required for hosting. Lightweight server runs in browser. Backend sends form data as a Telegram bot to your Telegram account.">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<h1>Hello there! Feel free to post your message/comment/query to me</h1>
<form method="POST" target="hidden_iframe">
<input type="hidden" name="From" value="EasyFormURL">
<div class="row mt-2">
<div class="col">
<input type="email" class="form-control" name="Email" placeholder="Your Email" autocomplete="on" required>
</div>
<div class="col">
<input type="text" class="form-control" name="Name" placeholder="Your Name" autocomplete="on" required>
</div>
<input type="text" class="form-control mt-2" name="Message" placeholder="Your Message" required>
</div>
<button type="submit" id="submit" class="btn btn-info mt-2" onclick="alert('Thanks for your message!');">Post</button>
<button type="reset" class="btn btn-warning mt-2">Reset</button>
</form>
<iframe name="hidden_iframe" src="about:blank" hidden></iframe>
<script>
let postTo = sessionStorage.getItem("postTo");
if (! postTo) { // No sessionStorage from earlier. This rules out reload.
postTo = atob(location.pathname.split('/').pop().replace(/_/g,'+').replace(/-/g,'/'));
sessionStorage.setItem("postTo", postTo);
// Post towards reporting new view of this page. Ignores page reloads by detecting presence of prior sessionStorage.
fetch(postTo, {
method: "POST",
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: "From=EasyFormViewCounter"
})
}
document.getElementById("submit").setAttribute("formaction", postTo);
</script>
</body>
</html>