Advertisement
Guest User

Untitled

a guest
Apr 17th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4. <title>Library management system</title>
  5.  
  6. <link rel="stylesheet" type="text/css" href="heading.css" title="heading">
  7.  
  8. <style>
  9. form
  10. {
  11. margin:2cm 8cm;
  12. padding: 2cm;
  13. color: white;
  14. font-size:23px;
  15. }
  16.  
  17. .button
  18. {
  19. width : 4cm;
  20. height : 1.5cm;
  21. background-color: #FFF000;
  22. border: none;
  23. border-radius:4px;
  24. color: #000080;
  25. padding: 15px 32px;
  26. text-align: center;
  27. text-decoration: none;
  28. display: inline-block;
  29. font-size: 20px;
  30. margin: 1cm 0cm;
  31. cursor: pointer;
  32. }
  33.  
  34. input
  35. {
  36. width : 8cm;
  37. height : 1cm;
  38. border: 1px solid #424949;
  39. border-radius:5px;
  40. font-size: 15px;
  41. color:#424949;
  42. margin : 0.5cm;
  43. }
  44.  
  45. span
  46. {
  47. color: red;
  48. font-size:20px;
  49. text-align:center;
  50. }
  51.  
  52. </style>
  53.  
  54. </head>
  55.  
  56. <body>
  57.  
  58. <img src="logo.jpg" alt="logo" id="logo">
  59. <h1>PSG COLLEGE OF TECHNOLOGY</h1>
  60. <h2>LIBRARY MANAGEMENT SYSTEM</h2>
  61.  
  62. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
  63.  
  64. ADMIN ID &nbsp;&nbsp;&nbsp;<input type="text" name="admin_id" required><br>
  65. PASSWORD <input type="password" name="admin_pass" required><br>
  66. <center><input type="submit" class="button" value="LOGIN">
  67. <span>
  68. <?php
  69.  
  70. if ($_SERVER["REQUEST_METHOD"] == "POST")
  71. {
  72. $a_id = $_POST['admin_id'];
  73. $a_pass = $_POST['admin_pass'];
  74. $user='root';
  75. $pass='';
  76. $db='rfid';
  77. $table='admin';
  78. $conn= new mysqli('localhost',$user,$pass,$db) or die('Unable to connect');
  79. $sql = "SELECT * FROM admin where id=1";
  80. $result = $conn->query($sql);
  81. if ($result->num_rows > 0)
  82. {
  83. while($row = $result->fetch_assoc())
  84. {
  85. if($row["admin_id"]==$a_id && $row["password"]==$a_pass){header("location:home.php");}
  86. else{echo "<br>Incorrect admin id or password";}
  87. }
  88. }
  89. else
  90. {
  91. echo "<br>cannot find the admin_id";
  92. }
  93.  
  94. $conn->close();
  95. }
  96.  
  97. ?>
  98. </span>
  99. </form>
  100.  
  101. </body>
  102.  
  103. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement