Skip to main content

Library System with OPAC


Hello guys if you are looking for Library System with OPAC I have here a Library System with OPAC in PHP and Mysql as a database. And has an excellent graphical user interface and user friendly environment. The application handles the book library transactions in an efficient way. I propose this system last year in DHGGMHS for a survey of my system for more information to make it more functionally and better.

Sample Codes

This code is for the function or connection in a database.

  1. <?php
  2. $db_host = "localhost";
  3. $db_username = "root";
  4. $db_pass = "";
  5. $db_name = "libsystem";
  6. mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
  7. mysql_select_db("$db_name") or die ("no database");
  8. ?>

This code is for the Login form or index that started the session of the system

  2. <html>
  3. <head>
  4. <title>Library System - Login</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <link rel="stylesheet" type="text/css" href="logger/reset.css">
  7. <link rel="stylesheet" type="text/css" href="logger/structure.css">
  8. <link rel="stylesheet" type="text/css" href="css/main.css" />
  9. <link rel="stylesheet" href="assets/css/bootstrap.min.css" type="text/css"/>
  10. <link rel="icon" type="image/png" href="media/images/library.png">
  11. </head>
  12. <?php
  13. ?>
  14. <body>
  15. <center><div id="header"><h1 class="header-login">DHGGMHS Library System</h1></div></center>
  16. <img class="bg_img" src="media/images/background_image.png">
  17. <form class="box login" method="POST">
  18. <label align="center"><font size="6" color="grey"><h3>LOGIN</h3></font></label>
  19. <fieldset class="boxBody">
  20. <label><h5>Username</h5></label>
  21. <input type="text" placeholder="Username" required name="username">
  22. <label><a href="#" class="rLink" tabindex="5" ></a><h5>Password</h5></label>
  23. <input type="password" placeholder="Password" required name="password">
  24. <input type="submit" class="btnLogin" value="Login" name="login">
  25. <input type="reset" class="btnLogin" value="Reset" name="reset" >
  26. <?php
  27. if (isset($_SESSION['username'])) {
  28. header('Location: main.php');
  29. }
  30. else{
  31. }
  32. if(isset($_POST['login'])){
  33. $username=$_POST['username'];
  34. $password=$_POST['password'];
  35. $passwords=md5($password);
  36. include('connection.php');
  37. $login = mysql_query("SELECT * FROM users WHERE username = '$username' and password = '$passwords'");
  38. if (mysql_num_rows($login) == 1){
  39. $_SESSION['username']=$_POST['username'];
  40. header("Location: main.php");
  41. }
  42. else{
  43. echo "
  44. <script language='javascript'>
  45. alert('Invalid Credentials');
  46. </script>
  47. ";
  48. }
  49. }
  50. ?>
  51. </form>
  52. </body>
  53. </html>

The features of this system are the following:

  • Add, Edit, Reserve, Borrow, Return and Delete Books
  • Add Category, Add User, and it has a Penalty to be added


And for the OPAC Form you can Search for books.

This system includes reporting of all books recorded, books reserved, books borrowed, past due books and penalties using Data Report. The feature of this system includes user maintenance and borrower's information, transactions such as adding new books, borrowing books and returning books.

For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at [email protected]
Hope you like and learn from this system.
Thank you.

Account information:

username: admin
password: password


Add new comment

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.