-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.php
106 lines (86 loc) Β· 3.07 KB
/
log.php
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<link href="css/thiss.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Josefin+Slab:100,300,400,600,700,100italic,300italic,400italic,600italic,700italic" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css2?family=Lobster&display=swap" rel="stylesheet">
<style>
hr {
max-width: 400px;
border-color: #999999;
}
</style>
<script>
$(document).ready(function () {
$("#login").click(function () {
email=$("#email").val();
password=$("#password").val();
$.ajax({
type:"POST",
url:"check.php",
data: "email=" + email + "&password=" + password,
success:function(html)
{
if(html=='true')
{
$("#add_err2").html('<div class="alert alert-success"> \
<strong>Authenticated</strong>. \ \
</div>');
window.location.href = "blog.php";
}
else if(html=="false")
{
$("#add_err2").html('<div class="alert alert-danger"> \
<strong>Authentication</strong> failed. \ \
</div>');
}
else
{
$("#add_err2").html('<div class="alert alert-danger"> \
<strong>Error</strong> processing request. Please try again. \ \
</div>');
}
},
beforeSend: function(){
$("#add_err2").html("loading...");
}
});
return false;
});
});
</script>
</head>
<body>
<?php require_once 'nav.php' ?>
<div class="contianer">
<div class="box">
<div class="row">
<div class="col-lg-12 ">
<hr><h3 class="font_simple text-center">
Log <strong> in </strong></h3>
<hr>
<br>
<div id="add_err2"></div>
<form role="form">
<div class="col-md-12 form-group"><label><b>Email</b></label><input type="text" id="email" name="email" class="form-control" maxlength="100"></div>
<div class="col-md-12 form-group"><label><b>Password</b></label><input type="password" id="password" name="password" class="form-control" maxlength="250"></div>
<div class="col-md-12 form-group"><button type="submit" id="login" class="btn btn-primary">Log In</button></div>
</form>
<div class="col-md-12 form-group"><a href="reg.php"><button type="submit" class="btn btn-primary">New Join Here</button></a></div>
</div></div></div></div>
<footer>
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<p>Copyright © The Cafeteria 2020</p>
</div></div></div>
</footer>
</body>
</html>