Simple PHP + MySQL frontend for a hotel reservation system. UI uses MDBootstrap + jQuery; backend is plain PHP with mysqli. Provided SQL dump seeds a complete sample database.
- Public homepage with carousel, gallery, contact map.
- Signup / login flows and session-based account pages.
- Rooms listing and room detail pages.
- Reservation, payment and basic admin/owner/receptionist tables (seeded).
- Static assets (CSS/JS/images) in
static/. - Server-side templates in
templates/.
- index.php — public entry (homepage)
- templates/ — PHP pages (login, signup, DB connect, roomdetail, profile, admin pages, etc.)
- static/ — CSS, JS and images
- 9hotel_reservation.sql — database dump (schema + seeded data)
- PHP 7.4+ with mysqli
- MySQL / MariaDB
- Web server (XAMPP, WAMP, IIS) or PHP built-in server
- (Optional) phpMyAdmin or mysql CLI to import the SQL dump
-
Put the project in your web root (e.g. XAMPP
htdocs) OR run built-in server:cd './Hotel_booking' php -S localhost:8000 # then open http://localhost:8000/index.php
-
Create the database and import the provided SQL:
- Using phpMyAdmin: create database name (e.g.
9hotel_reservation) then import9hotel_reservation.sql. - Using MySQL CLI:
mysql -u root -p CREATE DATABASE 9hotel_reservation CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; EXIT mysql -u root -p 9hotel_reservation < "./9hotel_reservation.sql"
- Using phpMyAdmin: create database name (e.g.
-
Configure DB connection:
- Edit
templates/connect.phpand set host, username, password, database name to match your environment. - Example connection variables you might see and edit:
// inside templates/connect.php // $db_host = '127.0.0.1'; // $db_user = 'root'; // $db_pass = 'your_password'; // $db_name = '9hotel_reservation'; // $conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
- Edit
-
Start the app and test:
- Open the homepage and navigate Rooms / Signup / Login flows.
- If you seeded the DB, sample accounts exist under
membertable (roles: customer, owner, recep, etc.)
- Do NOT commit credentials. If
templates/connect.phpcontains real credentials, remove them from git history and rotate them. - The SQL contains seeded user emails and bcrypt password hashes used in development only.
- Sanitize/validate user input before deploying to production.
- "Repository not found" when pushing: ensure remote URL is correct and you have permissions; create the remote repo on GitHub or use
gh repo create. - DB connection errors: verify credentials and the database name in
templates/connect.php. - Blank Rooms menu: verify
roomtable rows exist and connection is successful.
Add a LICENSE file if you plan to publish (e.g. MIT).