-
Notifications
You must be signed in to change notification settings - Fork 0
/
signin.php
executable file
·105 lines (92 loc) · 3.68 KB
/
signin.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Sign in · Twitter Bootstrap</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="style/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 40px;
padding-bottom: 40px;
background-color: #f5f5f5;
}
.form-signin {
max-width: 300px;
padding: 19px 29px 29px;
margin: 0 auto 20px;
background-color: #fff;
border: 1px solid #e5e5e5;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin input[type="text"],
.form-signin input[type="password"] {
font-size: 16px;
height: auto;
margin-bottom: 15px;
padding: 7px 9px;
}
</style>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="../assets/js/html5shiv.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="../assets/ico/favicon.png">
</head>
<body>
<div class="container">
<form class="form-signin">
<!-- 登录失败提示信息 -->
<div class="alert alert-error fade in" style="display:none">
<button type="button" class="close" onclick="javascript:dismiss()">×</button>
<strong>用户名或密码错误!</strong>
</div>
<h2 class="form-signin-heading">Please sign in</h2>
<input type="text" name="name" class="input-block-level" placeholder="User name">
<input type="password" name="pwd" class="input-block-level" placeholder="Password">
<a class="btn btn-large btn-primary" id="signin" href="javascript:void(0)">Sign in</a>
</form>
</div> <!-- /container -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="script/jquery.js"></script>
<script src="script/bootstrap.js"></script>
<script src="script/bootstrap-alert.js"></script>
<script type="text/javascript">
/*关闭登录失败提示信息*/
function dismiss(){
$(".alert").css('display','none');
}
$(document).ready(function(){
$('#signin').click(function(){
$.post("ajax/user.php",{"task":"signin","name":$("input[name='name']").val(),"pwd":$("input[name='pwd']").val()},function(json){
//存在此用户
if(json == '1'){
window.location.href="index.php";
}else{
$(".alert").css('display','block');
}
});
});
});
</script>
</body>
</html>