Repository navigation
Expand file tree
/
Copy pathadmin.php
More file actions
79 lines (65 loc) · 1.89 KB
/
Copy pathadmin.php
File metadata and controls
79 lines (65 loc) · 1.89 KB
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
<?php
include('config.php');
if (isset($_POST['login'])){
if (isset($_POST['email']) and isset($_POST['Password'])){
// Assigning POST values to variables.
$username =$_POST['email'];
$password =$_POST['Password'];
if($username=="" && $Password=="")
{
echo "<script type='text/javascript'>alert('Please Enter Username and Password')</script>";
}
else{
// CHECK FOR THE RECORD FROM TABLE
$query = "SELECT * FROM `admin` WHERE username='$username' and Password='$password'";
$result = mysqli_query($mysqli,$query) or die(mysqli_error($mysqli));
$count = mysqli_num_rows($result);
if ($count == 1){
header('location:adminhome.php');
}
else{
echo "<script type='text/javascript'>alert('Invalid Login Credentials')</script>";
}
}
}
}
?>
<?php
include('config.php');
if (isset($_POST['login2']))
{
header('location:forgot.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Login Form</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="container">
<div class="wrapper">
<h1><b>Welcome To Hotel Reservation</b></h1>
<form id="login-form" class="login-form" name="form1" method="post">
<input id="email" name="email" class="required" type="email" placeholder="Email">
<input id="Password" name="Password" class="required" type="Password" placeholder="Password">
<div class="row"><button type="submit" name="login" id="login" >LogIn</button></div>
<div class="row"><button type="submit" name="login2" id="login" >Forgot Password</button></div>
</form>
<ul class="bg-bubbles">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
</body>
</html>