This project is an Online Bus Ticket Reservation System built using PHP, MySQL, HTML, CSS, and JavaScript, powered by the XAMPP server. It allows users to browse available buses, select seats, book tickets, make payments, and view or cancel bookings. 🌟
-
🔐 User Authentication:
- Secure login and registration functionality for users.
-
🚌 Bus Browsing and Selection:
- View a list of available buses, including departure times, bus details, and available seats.
-
🎫 Seat Selection:
- Choose seats from the available ones on the selected bus.
-
💳 Payment Processing:
- Input payment details (such as card number, phone number, UPI ID) to confirm the booking.
-
📋 View Bookings:
- View all your bookings along with bus details, seat information, and booking ID.
-
❌ Cancel Tickets:
- Cancel previously booked tickets, making seats available for others.
- Frontend: HTML, CSS, JavaScript
- Backend: PHP
- Database: MySQL
- Server: XAMPP (Apache & MySQL)
-
Download and Install XAMPP:
- Download XAMPP from Apache Friends and install it.
-
Clone the Repository:
- Clone the project or download the ZIP and extract it to the
htdocs
directory inside your XAMPP installation folder:git clone https://github.com/Subramanian7986/Bus-Ticket-Reservation-Updated.git cd Bus-Ticket-Reservation-Updated
- Clone the project or download the ZIP and extract it to the
-
Import Database:
- Open phpMyAdmin via
http://localhost/phpmyadmin
. - Create a database named
bus_ticket_reservation
. - Import the
bus_ticket_booking.sql
file from the project directory into the newly created database.
- Open phpMyAdmin via
-
Update Database Configuration:
- Open the
db_connection.php
file and make sure the database credentials match your XAMPP setup:$servername = "localhost"; $username = "root"; // Default XAMPP username $password = ""; // Default XAMPP password is empty $dbname = "bus_ticket_reservation";
- Open the
-
Run the Project:
- Start Apache and MySQL from the XAMPP control panel.
- Access the project in your browser at
http://localhost/Bus-Ticket-Reservation-Updated
.
-
🏠 Homepage:
- Users can log in or register to access the system.
-
🚌 Bus Browsing:
- After logging in, users can browse available buses with details such as bus name, departure time, and available seats.
-
🎫 Seat Selection:
- Choose seats from the available ones for a selected bus.
-
💳 Payment:
- Enter payment details such as UPI ID, and confirm the ticket booking.
-
📋 View Bookings:
- Users can view all their booked tickets along with bus and seat details.
-
❌ Cancel Booking:
- Users can cancel their bookings, which will make the selected seats available for others to book.
/Bus-Ticket-Reservation-Updated
├── db_connection.php # 📊 Database connection file
├── first.html # 🏠 Initial page (optional placeholder)
├── index.php # 🏠 Homepage for login/registration
├── register.php # ✍️ User registration page
├── login.php # 🔑 User login page
├── bus_browsing.php # 🚌 Bus browsing and selection page
├── ticket_reservation.php # 🎫 Seat selection and reservation page
├── cancel_ticket.php # ❌ Cancel ticket functionality
├── payment.php # 💳 Payment processing page
├── view_booked.php # 📋 View booked tickets page
├── styles.css # 💅 CSS for styling the pages
├── bus_ticket_booking.sql # 🗄️ SQL file for database setup
Create a database named bus_ticket_reservation
.
Tables:
-
users:
- Stores user credentials (ID, username, email, password).
-
buses:
- Stores bus details (ID, name, departure/arrival time, route, etc.).
-
seats:
- Manages seat availability for each bus.
-
tickets:
- Stores ticket booking details (ID, user ID, bus ID, seat number, booking date).
- 📧 Email Notifications: Add email notifications for booking confirmations and cancellations.
- 📈 Dynamic Pricing: Introduce dynamic pricing based on demand and available seats.
- 📱 Responsive UI: Enhance the user interface with a responsive design for mobile compatibility.
- 💰 Online Payment Gateway: Integrate real payment gateways like PayPal, Stripe, or UPI for real-time transactions.
This project is licensed under the MIT License.
- Subramanian V
- 📧 Email: vsubramanianofficial@gmail.com
- 💼 LinkedIn: Subramanian V
Now you can easily browse buses, reserve tickets, and manage your bookings with this simple and efficient Bus Ticket Reservation System! 🎉