A full-stack Car Rental Web Application built with PHP, MySQL, Bootstrap, jQuery, and PHPMailer. Customers can browse cars, check prices, and make bookings; admins can manage vehicles, customers, and reservations.
This project was developed as a practical web application to demonstrate skills in backend development, authentication, database design, and UI integrations using a Bootstrap template.
- Implemented booking availability logic to prevent double bookings by updating vehicle status during active rentals
- Designed relational database schema for customers, cars, reservations, rentals, and payments
- Integrated Stripe payment gateway for secure transaction handling
- Built admin workflows for managing vehicle lifecycle (available, booked, maintenance)
Customer side
- View available cars with images, details, and daily price
- See individual car details page (
car-single.php) - Register and log in as a customer
- Secure login system with session handling
- Book or reserve cars from the listing or details page
- Contact form to send messages to the site owner
- Forget password flow:
- Request reset
- Email-based OTP verification (
forgetpassword.php®otpverify.php) - Update password (
updatepassword.php)
- Make payment securely,
Admin side
- Note: Admin pages are inside the
Admin/folder - Admin login dashboard
- Manage car inventory:
- Add/edit/delete cars
- Manage car details like plate, model, brand, price per day, etc.
- Manage the car for maintenance.
- View and manage reservations/bookings
- View registered customers
- View and respond to contact form submissions
- Basic reporting/overview of system activity
Authentication & Security (Basic)
- PHP session-based authentication for both Admin & Customer
- Email-based verification using PHPMailer
- Separate login flows (
login.php,register.php,logout.php)
Frontend
- HTML5
- CSS3
- Bootstrap4
- jQuery
- JavaScript
Backend
- PHP (Procedural)
- MySQL database
Libraries/tools
- PHPMailer for sending emails (OTP/password reset/contact)
- Bootstrap template based on Carbook (colorlib template)
- Stripe API (Payment gateway)
Prerequisites
- XAMPP
- PHP 7+ (or compatible)
- MySQL/MariaDB/phpMyAdmin
- Composer (Optional, only if you want to reinstall PHPMailer via Composer)
Clone the Repository
-
command: git clone https://github.com/ShivamManojPatel/Car-Rental-System.git && cd Car-Rental-System
-
Move the project into your web server root:
- For XAMPP (Windows): C:\xampp\htdocs\Car-Rental-System
- For XAMPP (MacOS): /Applications/XAMPP/xamppfiles/htdocs/
Database Setup
- Start Apache and MySQL from XAMPP.
- Open phpMyAdmin at: - http://localhost/phpmyadmin
- Create a new database, for example: - CREATE DATABASE car_rental;
- Import the SQL file from the Database File folder: - Go to the new database in phpMyAdmin - Click on import - Select .sql file inside Database File/ - Click Go
This will create the necessary tables (Users, Cars, Booking, etc.)
Configure Database Connection
Open datacon.php and update:
$server = "localhost";
$username = "root";
$password = ""; // Set MySQL password if you have one
$ dbname = "car_rental"; // Use the same name you created in phpMyAdmin
Save the file.
Configure Email (PHPMailer)
If you're using OTP or password reset features via email:
- Open the relevant files (e.g., regotpverify.php, forgotpassword.php, or PHPMailer config files)
- Configure:
- SMTP host (e.g., smtp.gmail.com)
- SMTP Port
- Username (email)
- App password (if using Gmail)
- From Address/name
Make sure less-secure apps or app passwords are configured correctly with your email provider.
Run the Application
Open your browser and go to:
From there, you can:
- Browse cars
- Register as a customer
- Log in and test booking flows
- Log in as Admin (after creating admin credentials in the DB or via a seed)
Admin Credentials
Depending on how you set up the database:
- Check the imported SQL file for any default admin user.
- If there's no default admin:
- Insert an admin row manually into the users table via phpMyAdmin.
- Example: insert into customer(CUS_FNAME, CUS_LNAME, CUS_EMAIL, CUS_PASSWORD, CUS_PHONE, CUS_LICENSE_NUM, USER_TYPE)values('John', 'Doe', 'Admin_CarRental@gmail.com', 'Admin123', '555-555-5555', '123-xyz', 'Admin')
- Here, CUS_EMAIL, CUS_PASSWORD, and USER_TYPE are important. This will help to log in as admin. And the Password should be hashed using the PHP password_hash() function
- Role-based access control (Different login flow for customer and admin. But, same login page).
- Secure integration payment gateway using Stripe.
- Booking status based on stage of booking for better understanding (Pending, confirmed, cancelled, completed).
- Filters for sorting cars for a better surfing experience (by price range, brand, transmission type, etc).
- Logging in before renting or making a reservation for security and audit.
- Refactor into an MVC structure or use a framework like Laravel later.
- Frontend UI based on the Carbook Bootstrap template from Colorlib.
- PHPMailer library for handling email features.
- Bootstrap, jQuery, Font Awesome, and related vendors inside vendor/ folder.
Shivam Patel, Krushi Patel & Smit Meghapara
Pace University | Seidenberg School of Computer Science and Information Systems