forked from Yazdwivedi/Inventory-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_login.php
61 lines (56 loc) · 1.92 KB
/
admin_login.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
<?php
require "db/connect.php";
session_start();
$counter=0;
if(isset($_POST["submit"]))
{
$name=trim($_POST["name"]);
$password=trim($_POST["password"]);
$check=$conn->query("select * from admin");
$row=$check->fetch_object();
if($name===$row->name and $password===$row->password)
{
$_SESSION["admin"]=name;
header("Location:admin_main.html");
die();
}
else
$counter=1;
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="admin_login.css">
<link rel="stylesheet" href="body.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<title>Admin Login</title>
</head>
<body>
<nav class="navbar navbar-dark bg-dark">
<a href="main.html" class="navbar-brand">Inventory Management System</a>
</nav>
<form class="inner text-center" action="" method="post">
<div class="inside text-center">
<div class="form-group form-row text-center">
<div class="col-mid-6">
<?php
if($counter)
echo "Username or Password is incorrect <br>";
?>
<label for="inputAddress"><span class="color">Name</span></label>
<input type="text" class="form-control" name="name" id="inputAddress" placeholder="Name">
</div>
</div>
<div class="form-group form-row text-center">
<div class="col-mid-12">
<label for="exampleInputPassword1"><span class="color"><span class="color">Password</span></span></label>
<input type="password" name="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
</div>
<button type="submit" name="submit" class="btn btn-primary text-center">Submit</button>
</div>
</form>
</body>
</html>