-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin-log.php
72 lines (61 loc) · 2.29 KB
/
admin-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
<?php
$login = 0;
$invalid = 0;
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
include('connection.php');
$ausername = $_POST['username'];
$apassword = $_POST['password'];
$sql = "Select * from admin where ausername='$ausername' and apassword='$apassword' ";
$result = mysqli_query($conn, $sql);
if ($result) {
$num = mysqli_num_rows($result);
if ($num > 0) {
$login = 1;
session_start();
$_SESSION['ausername'] = $ausername;
header('location:admin.php');
} else {
$invalid = 1;
}
} else
die(mysqli_error($conn));
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./css/login.css">
<title>Admin Log in</title>
</head>
<body>
<img src="./images/loginbg.jpg" alt="bgimage" width="100%">
<div class="login-container">
<div class="nav-bar">
<div class="popup">
<div class="form">
<h2 class="log-head">Admin Log In</h2>
<form action="admin-log.php" method="post">
<div class="elements">
<div class="name-form-element">
<label class="name-label" for="username">User name</label>
<input type="text" id="username" name="username" placeholder="Enter username">
</div>
<div class="pass-form-element">
<label class="pass-label" for="password">Password</label>
<input class="pass-inp" type="password" id="password" name="password" placeholder="Enter password">
</div>
<div class="form-element">
<button display="" class="button">Sign in →</button>
</div>
<div class="new">
<a class="new-link" href="login.php"> ← back</a>
</div>
</div>
</form>
</div>
</div>
</div>
</body>
</html>