forked from akkireddy95/Online-Banking-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminlogin.php
58 lines (52 loc) · 1.66 KB
/
adminlogin.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
<?php
session_start();
if(isset($_SESSION['admin_login']))
header('location:admin_homepage.php');
?>
<!DOCTYPE html>
<html>
<head>
<noscript><meta http-equiv="refresh" content="0;url=no-js.php"></noscript>
<meta charset="UTF-8">
<title>Admin Login - Online Banking</title>
<link rel="stylesheet" href="newcss.css">
</head>
<?php
include 'header.php'; ?>
<div class='content'>
<div class="user_login">
<form action='' method='POST'>
<table align="center">
<tr><td><span class="caption">Admin Login</span></td></tr>
<tr><td colspan="2"><hr></td></tr>
<tr><td>Username:</td></tr>
<tr><td><input type="text" name="uname" required></td></tr>
<tr><td>Password:</td></tr>
<tr><td><input type="password" name="pwd" required></td></tr>
<tr><td class="button1"><input type="submit" name="submitBtn" value="Log In" class="button"></td></tr>
</table>
</form>
</div>
</div>
<?php include 'footer.php';
?>
<?php
include '_inc/dbconn.php';
if(!isset($_SESSION['admin_login'])){
if(isset($_REQUEST['submitBtn'])){
$sql="SELECT * FROM admin WHERE id='1'";
$result=mysql_query($sql);
$rws= mysql_fetch_array($result);
$username= mysql_real_escape_string($_REQUEST['uname']);
$password= mysql_real_escape_string($_REQUEST['pwd']);
if($username==$rws[8] && $password==$rws[9]) {
$_SESSION['admin_login']=1;
header('location:admin_hompage.php'); }
else
header('location:adminlogin.php');
}
}
else {
header('location:admin_hompage.php');
}
?>