-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
45 lines (42 loc) · 1.19 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
<?php include('header.php'); ?>
<?php
session_start();
if (isset($_SESSION['id'])){
$query=mysqli_query($conn,"select * from user where userid='".$_SESSION['id']."'");
$row=mysqli_fetch_array($query);
if ($row['access']==1){
header('location:admin/');
}
else{
header('location:user/');
}
}
?>
<body>
<div class="container">
<div id="login_form" class="well">
<h2><center><span class="glyphicon glyphicon-lock"></span> Please Login</center></h2>
<hr>
<form method="POST" action="login.php">
Username: <input type="text" name="username" class="form-control" required>
<div style="height: 10px;"></div>
Password: <input type="password" name="password" class="form-control" required>
<div style="height: 10px;"></div>
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-log-in"></span> Login</button>
</form>
<div style="height: 15px;"></div>
<div style="color: red; font-size: 15px;">
<center>
<?php
if(isset($_SESSION['msg'])){
echo $_SESSION['msg'];
unset($_SESSION['msg']);
}
?>
</center>
</div>
</div>
</div>
<?php include('script.php'); ?>
</body>
</html>