-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
71 lines (63 loc) · 2.07 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
<?php
session_start();
ob_start();
$msg="";
include 'db.php';
if(isset($_POST['submit'])){
extract($_POST);
print_r($_POST);
$sql="SELECT * FROM admin WHERE `name`='$aname' and `password`='$password'";
$result=$db->query($sql);
if($result->num_rows>0){
$row=$result->fetch_assoc();
$_SESSION["AID"]=$row["id"];
$_SESSION["ANAME"]=$row["name"];
header("location:ahome.php");
}else{
$msg="Login Error";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DDU-GKY</title>
<link rel="shortcut icon" href="images/logo.png" type="image/x-icon">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<section class="head">
<div class="header">
<div class="logo">
<img src="images\coat_arms_india_PNG17.png">
</div>
<div class="banner">
<img src="images/Artboard 1.png">
</div>
<div class="login">
<a href="index.php">Home</a>
</div>
</div>
</section>
<section id="form">
<form action="" method="post" class="form" autocomplete="off">
<center>
<h1>ADMIN LOGIN</h1>
<div class="input">
<label>USER NAME</label>
<input type="text" name="aname">
<label>PASSWORD</label>
<input type="password" name="password">
<input type="submit" name="submit" value="LogIn">
<p class="error">
<?php echo $msg;?>
</p>
</div>
</center>
</form>
</section>
</body>
</html>