-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdminLog.php
136 lines (118 loc) · 3.02 KB
/
AdminLog.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="Description" content="A Registration Form">
<meta name="Author" content="Nanda">
<center><h1>Admin Page</h1></center>
</head>
<style>
body
{
background-image:url("images/yellow.jpg");
background-repeat:no-repeat;
background-size: cover;
margin-left:200px;
margin-right:200px;
margin-top:100px;
}
table
{
background-color:#BAC8DF;
border-radius:20px;
border:1px solid;
}
.table
{
background-color:#484646;
border-radius:20px;
font-color:white;
border:1px solid;
opacity:0.8;
}
form{
text-align:justify;
font-size:20px;
}
input
{
border-radius: 17px;
border-radius: 17px;
border-radius: 17px;
border-radius: 17px;
border:solid 1px;
padding:10px;
}
.text
{
width:200px;
}
.button
{
background-color: white;
border:2px solid #484646;
width:200px;
color: black;
padding: none;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
.button:hover
{
background-color: #392F2F;
color: white;
}
</style>
<body>
<link rel="stylesheet" type="text/css" href="Horizontal.css">
<ul>
<li style="float:left"><a class="active"href="Home.php">Home</a></li>
<li><a href="">About</a></li>
<li><a href="Signin.php">Application</a></li>
<li><a href="AdminLog.php">Admin</a></li>
<li><a href="DonorSignin.php">Donate</a></li>
<li><a href="SponsorSignin.php">Sponsor</a></li>
<li><a href="contact.php">Contact Us</a></li>
<li><a href="">FAQ</a></li>
<li><a href="">Feedback</a></li>
</ul></align>
<table>
<table cellpadding="15" align="center" class="table">
<form action="" method="POST">
<tr>
<td>Username:</td>
<td><input type="text" class="text" name="username"></td>
</tr>
<tr>
<td>Password:</td><br>
<td><input type="password" class="text" name="password"></td>
</tr>
</table><br>
<center><b><input type="submit" class="button" name="login" value="Sign In"></b></center><br>
<center><input type="reset" class="button" name="reset" value="Clear"></center><br>
</table>
<h3><center><a href="Home.php">Home</a></center></h3>
</body>
</html>
<?php
session_start();
?>
<?php
require('db.php');
if (isset($_POST['username'])){
$username = stripslashes($_REQUEST['username']); // removes backslashes
$username = mysqli_real_escape_string($con,$username); //escapes special characters in a string
$password = stripslashes($_REQUEST['password']);
$password = mysqli_real_escape_string($con,$password);
$query = "SELECT * FROM `adminlog` WHERE username='$username' and password='$password'";
$result = mysqli_query($con,$query) or die(mysql_error());
$rows = mysqli_num_rows($result);
if($rows==1){
header("Location: adminhome.php"); // Redirect user to index.php
}else{
echo "<div class='form'><h3>Username/password is incorrect.</h3><br/></div>";
}
}
?>