-
Notifications
You must be signed in to change notification settings - Fork 5
/
admin.php
117 lines (101 loc) · 4.19 KB
/
admin.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
include_once 'database.php';
session_start();
if(isset($_SESSION["email"]))
{
session_destroy();
}
$ref=@$_GET['q'];
if(isset($_POST['submit']))
{
$email = $_POST['email'];
$password = $_POST['password'];
$email = stripslashes($email);
$email = addslashes($email);
$password = stripslashes($password);
$password = addslashes($password);
$email = mysqli_real_escape_string($con,$email);
$password = mysqli_real_escape_string($con,$password);
$result = mysqli_query($con,"SELECT email FROM admin WHERE email = '$email' and password = '$password'") or die('Error');
$count=mysqli_num_rows($result);
if($count==1)
{
session_start();
if(isset($_SESSION['email']))
{
session_unset();
}
$_SESSION["name"] = 'Admin';
$_SESSION["key"] ='admin';
$_SESSION["email"] = $email;
header("location:dashboard.php?q=0");
}
else
{
echo "<center><h3><script>alert('Sorry.. Wrong Username (or) Password');</script></h3></center>";
header("refresh:0;url=admin.php");
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Admin LogIn</title>
<!-- STYLESHEETS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="CSS/login_style.css">
<!-- GOOGLE FONTS -->
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Audiowide&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap" rel="stylesheet">
<!-- SCRIPTS -->
<script src="https://kit.fontawesome.com/9a36302444.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
</head>
<body>
<!-- <section id="navigation-bar">
<nav class="navbar navbar-expand-lg navbar-dark">
<a class="navbar-brand" href="../front page/index.php">
<img src="ASSETS/icon.png" width="50" height="50" class="d-inline-block align-top" alt="">
Brain Quest
</a>
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="index.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="login.php">Log in</a>
</li>
<li class="nav-item">
<a class="nav-link" href="register.php">Register</a>
</li>
</div>
</div>
</nav>
</section> -->
<div class="container">
<div class="Login">
<h1>Admin Login</h1>
</div>
<form method="post" action="admin.php" enctype="multipart/form-data">
<div class="box">
<i class="fa-solid fa-envelope"></i>
<input type="Email ID" name="email" id="Email ID" placeholder="Email ID">
</div>
<div class="box">
<i class="fa-solid fa-key"></i>
<input type="password" name="password" id="password" placeholder="Password">
</div>
<button class="spec" name="submit">Enter</button>
</form>
</div>
</body>
</html>