-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhamid_admin.php
233 lines (148 loc) · 4.12 KB
/
hamid_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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<?php
session_start();
?>
<!doctype html>
<html>
<head>
<style>
body{
background#f5f5f0;
}
#menu{
background:#2F4F4F;
height:40px;
margin-top:-16px;
border-bottom:2px solid green;
}
#menu ul{
list-style-type:none;
margin-left:50px;
}
#menu ul li{
float:left;
border-right:1px solid black;
}
#menu ul li:last-child{
border:none;
}
#menu ul li a{
text-decoration:none;
padding:10px 20px;
display:block;
color:red;
font-size:25px;
padding-bottom: 5px;
}
#menu ul li a:hover{
background:white;
}
#footer{
height:200px;
padding:10px;
margin-top:500px;
background:#900C3F;
}
#footer:hover{
background:black;
color:green;
}
#footer td{
margin-left:100px;
}
#contact{
float:left;
width:400px;
}
#contact h2{
border-bottom:1px solid black;
}
#social{
float:left;
width:400px;
}
#social h2{
border-bottom:1px solid black;
}
#About{
float:left;
width:400px;
}
#About h2{
border-bottom:1px solid black;
}
#About p{
background:white;
padding:15px;
}
#date h3{
float:left;
padding:15px;
margin-bottom:10px;
}
</style>
</head>
<body>
<div id="menu">
<ul>
<li> <a href="hall.php"><b>Home</b></a></li>
</ul>
</div>
<div>
<form action="" method="POST">
<table border="3" align="center" width="500" bgcolor='blue' >
<tr>
<th bgcolor="yellow" colspan="5"> ADMIN Login form </th>
</tr>
<tr>
<td align="right" bgcolor="orange">Name:</td>
<td> <input type="name" name="name" required> </td>
</tr>
<tr>
<td align="right" bgcolor="orange" >Password:</td>
<td> <input type="password" name="password" required> </td>
</tr>
<td align="right" colspan="6">
<input type="submit" name="submit" value="Submit" ></td>
<tr>
</table>
</form>
<center><font color="red" size="3" align="center"><b> <?php echo @$_GET['log']; ?> </b> </font> </center>
<div id="footer">
<div id="contact">
<h2>Contact Us</h2>
<form>
Mailing Address:<input type="submit" value="[email protected]" size="20" required /> <br>
Mobile: <input type="submit" value="01757967689" size="20" required /><br>
Address: <input type="submit" value="RUET,Rajshahi" size="20" required /> <br>
</form>
</div>
<div id="social"> <h2>Social Links</h2>
<form>
Facebook: <a href="https://www.facebook.com/zubayerhossain.com" target="_blank"><img src="img/facebook.png" height="35px"/> <a/> <br>
Instagram: <a href="https://www.instagram.com/zubayerhossain/" target="_blank"><img src="img/instragram.png" height="35px"/> <a/> <br>
</form>
</div>
<div id="date"> <h3> copyright ©<?php echo date("M"); ?> <?php echo date("Y"); ?> <?php echo date("D"); ?> </h3> </div>
</div>
</body>
</html>
<?php
$conn=mysqli_connect("localhost","root","","sessionpractical");
if(isset($_POST['submit'])){
$u_name = $_POST['name'];
$u_password=$_SESSION['hamid']=($_POST['password']);
$result=("
select name,password
from signin
where name='$u_name'
and password='$u_password'
") or die('fail');
$ans=mysqli_query($conn,$result);
if( mysqli_num_rows($ans)>0){
header ('location:hamid_show.php');
}
if( mysqli_num_rows($ans)==0) {
echo "<script>alert('incorrect username or password')</script>";
}
}
?>