-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathindex.php
72 lines (65 loc) · 1.99 KB
/
index.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
<?php
session_start();
if(isset($_GET["retry"])){
$wrong='<div class="inputbox">
<span style="color:#df3a01;font-size:10px;margin:10px;display:block">用户名或密码错误</span>
</div>';
}
if (!$_SESSION['login']==true) {
print <<<END
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, height=device-height, inital-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="static/login.css" type="text/css" media="all" />
<title>登录到系统 - 学生选课信息管理系统</title>
</head>
<body>
<div class="loginbox">
<div class="title">
<span>
学生选课信息管理系统
</span>
</div>
<div class="subtitle">
用户登录
</div>
<form action="./login.php" method="post">
<div class="inputbox">
<span>帐号</span>
<input name="user" required type="text">
</div>
<div class="inputbox">
<span>密码</span>
<input name="pass" required type="password">
</div>
<div class="submitbox">
<input name="submit" type="submit" value="提交">
</div>
$wrong
</form>
</div>
<div class="footer">
Copyright © 2019 Database Course Design. All rights reserved.
</div>
<!-- Written by mrning -->
<!-- 2019.12 -->
</body>
</html>
END;
exit();
}
else{
if(isset($_SESSION["admin"])){
header ("HTTP/1.1 302 Moved Temporatily");
header ("Location: "."./admin/");
exit();
}
else{
header ("HTTP/1.1 302 Moved Temporatily");
header ("Location: "."./user/");
exit();
}
}
?>