A production-ready, feature-rich Online Library Management System built with pure PHP (Procedural), MySQL, and modern frontend technologies. Supports complete user & admin workflows with real-time book availability, reservation system, and role-based access control.
🔥 Live Demo: https://shohancs.com/projects/Library_Management_System/
⚡ GitHub: https://github.com/shohancs/Library_Management_System
| Role | Access Link | Password | |
|---|---|---|---|
| 👤 User | User Login → | user@gmail.com |
12345 |
| 🧑💼 Admin | Admin Dashboard → | admin@gmail.com |
12345 |
- Register & secure login
- Browse & search books with filters
- Reserve books with custom receive/return dates
- View active & past reservations
- Cancel bookings anytime
- Responsive & user-friendly UI
- Full CRUD for Books, Users, Categories & Blogs
- Manage reservations (Approve | Issue | Return | Cancel)
- Real-time book availability tracking
- Role-based access control
- Rich text blog management using CKEditor
- Dynamic book availability (
available_copiesauto update) - Proper booking lifecycle management
- AJAX-powered search & filtering
- Session-based authentication
- Responsive design (Bootstrap 5)
| Layer | Technology |
|---|---|
| Backend | PHP (Procedural) |
| Database | MySQL |
| Frontend | HTML, CSS, Bootstrap 5, JavaScript, jQuery |
| Editor | CKEditor 5 |
| Others | AJAX, SweetAlert2, Datepicker |
User Flow:
Browse books → Search/Filter → Login/Register → Select receive/return date → Reserve → Confirm booking (recorded in DB) → Optionally cancel reservation.
Admin Flow:
Admin login → Dashboard → Manage books, users, and bookings → Update booking status (Approved/Received/Returned/Cancelled).
Data Flow:
Frontend (Form/AJAX) → PHP (backend) → MySQL → Returns data (HTML/JSON) → Displayed dynamically in UI.
🔒 For security best practices demonstrated in this project:
- Passwords are hashed using
sha1()& verified withpassword_verify() - Session hijacking & fixation protection
- CSRF protection in forms
- Input sanitization & prepared statements (where applicable)
Typical Booking Logic
- Insert new booking → status:
pending - Decrease
available_copiesby 1 (if > 0) - Admin updates booking → (approved / returned / cancelled)
- Returned/cancelled → increase
available_copiesby 1
Library_Management_System/
├── admin/
│ ├── dashboard.php
│ ├── manage_books.php
│ ├── manage_users.php
│ └── ...
├── assets/
│ ├── css/
│ ├── js/
│ ├── images/
├── includes/
│ ├── header.php
│ ├── footer.php
│ └── db.php
├── user/
│ ├── login.php
│ ├── register.php
│ └── reserve_books.php
└── database/
└── online_library.sql
- Clone this repository:
git clone <your-repo-url> cd Library_Management_System
- Create a new database in MySQL and import:
database/online_library.sql - Update your DB connection in:
Example:
includes/db.php$conn = mysqli_connect("localhost", "root", "", "online_library");
- Start local server (e.g., XAMPP/LAMP) and run:
http://localhost/Library_Management_System/
Shohanur Rahman Shohan
📧 shohancs.dev@gmail.com
🌐 https://shohancs.com
MIT License
Free to use for educational purposes.
