-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify.html
64 lines (47 loc) · 1.51 KB
/
verify.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<title>Verify Email</title>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body> <!-- hello evin--> <!-- hewwo -->
<h2>To verify your email, please enter your username and email token</h2>
<h3>Username:</h3>
<input id="username"></input>
<h3>Email Token:</h3>
<input id="email-token"></input>
<button id="submit">Submit</button>
</body>
<script>
let submit = async function () {
const pathToPhpFile = 'http://ec2-54-157-162-187.compute-1.amazonaws.com/quizlet/verifyemail.php';
a = JSON.parse(await $.ajax({
type: 'POST',
url: pathToPhpFile,
data: {
'token': document.getElementById('email-token').value,
'username': document.getElementById('username').value,
},
success: function (msg) {
console.log(msg);
},
failure: function (msg) {
//alert('failedreq')
obj = { 'status': 'requestfailed' };
}
}));
console.log(a);
if(a["status"] == true){
alert("Successfully verified email!");
window.close();
}
else{
alert("Could not verify email. Please try again.");
}
};
document.getElementById("submit").addEventListener("click", async function () { submit() }, false);
</script>
</html>