-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.html
61 lines (52 loc) · 1.54 KB
/
login.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
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script>
<head>
<title>"Login"</title>
<meta charset = "utf-8"/>
</head>
<body>
<h1>
Login
</h1>
<form id="loginform" action="javascript:void(0)" method = "post">
<p id="username">
<label for="username">Username</label>
<input required id="user" name = "user" type="text" required/>
</p>
<p id="password">
<label for="password">Password</label>
<input required id="pass" name = "pass" type="password" required/>
</p>
<br/ >
<input type="submit" id="continue" name="continue" value="Continue"/>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#loginform').submit(function() {
$.ajax({
method: "post",
type: "post",
url: 'checkLogin.php',
data: {
username: $("#user").val(),
password: $("#pass").val()
},
success: function(data)
{
if (data === 'true') {
window.location.replace('viewPosts.php');
}
else {
alert('Invalid Credentials');
}
}
});
});
});
</script>
`
<br/ >
<a href="signup.html">Sign up here</a>
</body>
</html>