-
Notifications
You must be signed in to change notification settings - Fork 0
/
alogin.php
67 lines (63 loc) · 1.85 KB
/
alogin.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
<?php
$page_title = "a-login";
include("./config/constants.php");
if (isset($_SESSION['login_faild'])) {
$msg = $_SESSION['login_faild'];
echo $msg;
unset($msg);
}
?>
<style>
.btn-group .btn-primary{
display: none;
}
</style>
<!DOCTYPE html>
<html lang="en">
<body>
<div class="flex">
<div>
<h1>Login</h1>
</div>
</div>
<section class="login-btn-sec">
<div class="login-btn-box">
<br>
<h4>Login as admin :</h4><br><br>
<form action="" method="POST">
<div class="input-group mb-3">
<span class="input-group-text" id="basic-addon1"><i class="fa-solid fa-user"></i></span>
<input name="adid" type="text" class="form-control" placeholder="Enter Id" aria-label="Username" aria-describedby="basic-addon1">
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="basic-addon1"><i class="fa-solid fa-lock"></i></span>
<input name="adpass" type="password" class="form-control" placeholder="Enter Password" aria-label="Password" aria-describedby="basic-addon1">
</div>
<br>
<input name="submit" class="btn btn-primary" type="submit" value="Login" aria-label=".form-control-sm example">
</form>
</div>
</section>
<br><br>
<?php
if(isset($_POST['submit']))
{
$id=$_POST['adid'];
$password=$_POST['adpass'];
$q="SELECT * FROM admin WHERE aid='$id' && apassword='$password'";
$res=mysqli_query($conn,$q);
if($res->num_rows>0)
{
$_SESSION['aid']=$id;
header('location:dashboard.php');
}
else
{
$msg="<script>alert('Invalid ID or Password')</script>";
echo $msg;
unset($msg);
}
}
?>
</body>
</html>