-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminSignIn.php
87 lines (65 loc) · 2.14 KB
/
adminSignIn.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
<?php
session_start();
require "Database.php";
require "books.php";
$databaseConnection = new DatabaseConnection;
$book = new Books;
include("connection.php");
$user_name = $password = "";
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$user_name=$_POST['userName'];
$password=$_POST['password'];
$sql = "SELECT * FROM Admin WHERE adminUserName = '$user_name' and password = '$password'";
$result = mysqli_query($conn, $sql);
if(mysqli_num_rows($result) >= 1) {
//session_register("myusername");
//$_SESSION['login_user'] = $myusername;
$_SESSION['admin_User']= $user_name;
header("location: adminIndex.php");
exit();
}else {
echo "<script>
alert('Your Login Name or Password is invalid');
</script>";
$error = "Your Login Name or Password is invalid";
}
}
?>
<html>
<head>
<meta charset="UTF-8">
<title>Library Management System</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type = "text/css">
body {
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
background-image:url("banner.png");
color:white;
}
.box {
border:#666666 solid 1px;
}
</style>
</head>
<body bgcolor = "#FFFFFF">
<div align = "center" style="margin:10%;">
<div style = "width:300px; border: solid 1px #333333;background:grey; " align = "left">
<div style = "background-color:#333333; color:#FFFFFF; padding:3px;height:30px;text-align:center;"><b>LIBRARY MANAGEMENT SYSTEM</b></div>
<div style = "margin:30px">
<h2>Admin Sign In</h2>
<form action="" method="post">
<input type="text" name="userName" placeholder="User Name" style="width:100%;" >
<br>
<br>
<input type="password" name="password" placeholder="Password" style="width:100%;">
<br><br>
<input type="submit" style="width:100%;background-color: black; height:30px; border: none;
color: white;padding: 1%;" value="Login" name="login">
</form>
</div>
</div>
</div>
</body>
</html>