A complete online bookstore website built with PHP and MySQL.
This is a web development project for learning PHP, MySQL, and web design.
- Browse books by categories (Fiction, Self-Help, Finance, Science & Technology, Children)
- Search and filter books
- View book details with descriptions and reviews
- Add books to shopping cart
- Wishlist to save favorite books
- Place orders with Cash on Delivery payment
- Track order status
- User registration and login
- View order history
- Get discounts on selected books
- Admin login (separate from users)
- Add new books with details
- Edit existing books
- Delete books
- Set discounts on books
- View all orders
- Manage inventory
- Contact Us form
- Help Center with FAQs
- Track Order page
- Returns & Refund policy
- Shipping Information
- Privacy Policy
- Terms of Service
- Cookie Policy
- Frontend: HTML5, CSS3, Bootstrap 5.3.3, JavaScript
- Backend: PHP 8.2.12
- Database: MySQL/MariaDB 10.4.32
- Server: XAMPP (Apache + MySQL)
- Icons: Bootstrap Icons
- Fonts: Google Fonts (Inter)
[Home Page] [Login Page] [Register Page] [Admin Dashboard]
- XAMPP (with Apache and MySQL)
- Web Browser (Chrome, Firefox, Edge, etc.)
- Text Editor (VS Code recommended)
- Download from: https://www.apachefriends.org/
- Install and start Apache and MySQL
1. Copy the 'bookshop' folder to: C:\xampp\htdocs\
2. Your project path should be: C:\xampp\htdocs\bookshop\
1. Open browser and go to: http://localhost/phpmyadmin
2. Click "New" to create database
3. Database name: bookstore_db
4. Click "Create"
1. Select 'bookstore_db' database
2. Click "Import" tab
3. Click "Choose File"
4. Select: bookstore_db.sql (from project folder)
5. Click "Go" button at bottom
6. Wait for success message
Open config/db.php and check these settings:
$host = 'localhost';
$username = 'root';
$password = ''; // Leave empty for default XAMPP
$database = 'bookstore_db';
$port = 3307; // Change to 3306 if neededOpen browser and visit: http://localhost/bookshop/
- Register new account from website
- Or use existing user if imported from database
- Go to: http://localhost/bookshop/pages/admin_login.php
- Check database 'admins' table for credentials
- Default admin should be in the SQL file
bookshop/
βββ index.php # Homepage
βββ book_details.php # Individual book page
βββ assets/
β βββ css/
β β βββ style.css # All styling
β βββ images/ # Book images
β βββ js/
β βββ script.js # JavaScript
βββ config/
β βββ db.php # Database connection
β βββ mail.php # Email configuration
βββ includes/
β βββ head.php # HTML head section
β βββ navbar.php # Navigation bar
β βββ footer.php # Footer section
β βββ scripts.php # JavaScript includes
βββ pages/
β βββ view_book.php # Browse all books
β βββ view_cart.php # Shopping cart
β βββ view_wishlist.php # Wishlist page
β βββ view_order.php # Order history
β βββ register.php # User registration
β βββ login_user.php # User login
β βββ user_profile.php # User profile
β βββ add_to_cart.php # Add item to cart
β βββ place_order.php # Place order
β βββ admin_login.php # Admin login
β βββ admin_dashboard.php # Admin panel
β βββ add_book.php # Add new book
β βββ edit_book.php # Edit book
β βββ contact_us.php # Contact form
β βββ help_center.php # FAQ page
β βββ [more pages...]
βββ bookstore_db.sql # Database file
- Purple: #6B46C1
- Teal: #14B8A6
- Amber: #F59E0B
For email notifications (order confirmation, contact form):
- Requires Gmail account with App Password
- Test using
test_email.php
If you get "Connection refused" error:
- Check if MySQL is running in XAMPP
- Try changing port from 3307 to 3306 in
db.php
- Book images use Open Library URLs
- Make sure you have internet connection
- Or upload local images to
assets/images/
- Check Apache is running in XAMPP
- Verify folder is at:
C:\xampp\htdocs\bookshop\ - Use correct URL:
http://localhost/bookshop/
- This is a learning project, not production-ready
- Passwords are hashed using PHP's
password_hash() - SQL injection prevented using prepared statements
- Session management for user authentication
- Bootstrap for responsive design
This project covers:
- PHP basics and OOP concepts
- MySQL database design
- CRUD operations (Create, Read, Update, Delete)
- User authentication and sessions
- Shopping cart functionality
- File uploads
- Form validation
- Responsive web design
- CSS styling and animations
- Book covers from Open Library
- Icons from Bootstrap Icons
- Framework: Bootstrap 5
- Fonts: Google Fonts
This project was developed by:
If something doesn't work:
- Check XAMPP - Apache and MySQL are running
- Check database is imported correctly
- Check file paths are correct
- Look for error messages in browser
- Check PHP error log in XAMPP
Project: BookNest - Online Bookstore
Type: Team Project
Purpose: Educational/Learning
Year: 2025
Version: 1.0