Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Library management system</title>
- <link rel="stylesheet" type="text/css" href="heading.css" title="heading">
- <style>
- form
- {
- margin:2cm 8cm;
- padding: 2cm;
- color: white;
- font-size:23px;
- }
- .button
- {
- width : 4cm;
- height : 1.5cm;
- background-color: #FFF000;
- border: none;
- border-radius:4px;
- color: #000080;
- padding: 15px 32px;
- text-align: center;
- text-decoration: none;
- display: inline-block;
- font-size: 20px;
- margin: 1cm 0cm;
- cursor: pointer;
- }
- input
- {
- width : 8cm;
- height : 1cm;
- border: 1px solid #424949;
- border-radius:5px;
- font-size: 15px;
- color:#424949;
- margin : 0.5cm;
- }
- span
- {
- color: red;
- font-size:20px;
- text-align:center;
- }
- </style>
- </head>
- <body>
- <img src="logo.jpg" alt="logo" id="logo">
- <h1>PSG COLLEGE OF TECHNOLOGY</h1>
- <h2>LIBRARY MANAGEMENT SYSTEM</h2>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- ADMIN ID <input type="text" name="admin_id" required><br>
- PASSWORD <input type="password" name="admin_pass" required><br>
- <center><input type="submit" class="button" value="LOGIN">
- <span>
- <?php
- if ($_SERVER["REQUEST_METHOD"] == "POST")
- {
- $a_id = $_POST['admin_id'];
- $a_pass = $_POST['admin_pass'];
- $user='root';
- $pass='';
- $db='rfid';
- $table='admin';
- $conn= new mysqli('localhost',$user,$pass,$db) or die('Unable to connect');
- $sql = "SELECT * FROM admin where id=1";
- $result = $conn->query($sql);
- if ($result->num_rows > 0)
- {
- while($row = $result->fetch_assoc())
- {
- if($row["admin_id"]==$a_id && $row["password"]==$a_pass){header("location:home.php");}
- else{echo "<br>Incorrect admin id or password";}
- }
- }
- else
- {
- echo "<br>cannot find the admin_id";
- }
- $conn->close();
- }
- ?>
- </span>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement