-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
81 lines (68 loc) · 1.79 KB
/
index.php
File metadata and controls
81 lines (68 loc) · 1.79 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
80
81
<?php
include "database.php";
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Advanced Student Portal</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body class="back">
<?php include"navbar.php";?>
<div style="text-align:center;">
<img src="img/logo.png" width="250" height="250">
<div>
<div class="login">
<h1 class="heading">Admin Login</h1>
<div class="log">
<?php
if(isset($_POST["login"]))
{
$sql="select * from admin where ANAME='{$_POST["aname"]}' and APASS='{$_POST["apass"]}'";
$res=$db->query($sql);
if($res->num_rows>0)
{
$ro=$res->fetch_assoc();
$_SESSION["AID"]=$ro["AID"];
$_SESSION["ANAME"]=$ro["ANAME"];
echo "<script>window.open('admin_home.php','_self');</script>";
}
else
{
echo "<div class='error'>Invalid Username or Password</div>";
}
}
if(isset($_GET["mes"]))
{
echo "<div class='error'>{$_GET["mes"]}</div>";
}
?>
<form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
<label>User Name</label><br>
<input type="text" name="aname" required class="input"><br><br>
<label>Password </label><br>
<input type="password" name="apass" required class="input"><br>
<button type="submit" class="btn" name="login">Login</button>
</form>
</div>
</div>
<br>
<br>
<br>
<div class="footer">
<footer><p>Copyright © 2020 </p></footer>
</div>
<script src="js/jquery.js"></script>
<script>
$(document).ready(function(){
$(".error").fadeTo(1000, 100).slideUp(1000, function(){
$(".error").slideUp(1000);
});
$(".success").fadeTo(1000, 100).slideUp(1000, function(){
$(".success").slideUp(1000);
});
});
</script>
</body>
</html>