-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
executable file
·64 lines (57 loc) · 1.85 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
<?php
session_start();
if(isset($_SESSION['unique_user_id'])){
if(isset($_SESSION['status'])){
header("Location:admin.php");
exit;
}
else{
header("Location:quiz.php");
exit;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Login | Quiz</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<div class="limiter">
<div class="container-login100">
<div class="wrap-login100 p-t-50 p-b-90">
<form action="db/checklogin.php" target="_self" method="post" class="login100-form validate-form flex-sb flex-w">
<span class="login100-form-title p-b-51">
Login
</span>
<div class="wrap-input100 validate-input m-b-16" data-validate="Username is required">
<input class="input100" type="text" name="username" placeholder="Username">
<span class="focus-input100"></span>
</div>
<div class="wrap-input100 validate-input m-b-16" data-validate="Password is required">
<input class="input100" type="password" name="pass" placeholder="Password">
<span class="focus-input100"></span>
</div>
<?php
if(isset($_SESSION['flag'])){
echo "<div class='warning' style='color:red; font-size:14px;'>";
echo "<p>username or password incorrect</p>";
echo "</div>";
session_destroy();
}
?>
<div class="container-login100-form-btn m-t-17">
<Input type="submit" name="submit" value="Login" class="login100-form-btn">
</div>
</form>
</div>
</div>
</div>
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>