Skip to content

A dynamic bus ticket booking system using PHP, Apache, and MySQL. Users can search routes, choose seats, make payments, and download tickets. Admins can manage buses, schedules, and special trips.

Notifications You must be signed in to change notification settings

moniieekaa/Bus_ticket_booking_using_php

Repository files navigation

# Bus Ticket Booking Website

A full-fledged **Bus Ticket Booking System** built using **PHP**, **Apache**, and **MySQL**, designed to streamline the process of booking bus tickets online. This application provides separate modules for both **users** and **administrators**, ensuring a complete and dynamic booking experience.

---

## ✨ Key Features

### For Users:
- **Search Buses**: Enter source, destination, and travel date to view available buses.
- **Select Seats**: Choose from available seat numbers visually.
- **Book & Pay**: Proceed with the booking and confirm via a simulated payment gateway.
- **Download Tickets**: Receive a downloadable ticket with booking details post-payment.

### For Admin:
- **Add/Edit Buses**: Add new buses, update or remove existing ones.
- **Manage Schedules**: Set routes, dates, and available seats.
- **Special Trips**: Add extra buses for holidays, festivals, or special events.
- **Monitor Bookings**: View all ticket bookings and track system activity.

---

## 🛠️ Tech Stack Used

| Layer        | Technology               |
|--------------|--------------------------|
| Frontend     | HTML, CSS, JavaScript, Bootstrap |
| Backend      | PHP                      |
| Database     | MySQL                    |
| Server       | Apache (via XAMPP/LAMP)  |
| Others       | PHPMyAdmin               |

*Bootstrap is used for responsive and modern UI components, while JavaScript adds interactivity, such as seat selection and form validations.*

---

## 📂 Project Structure

/bus-ticket-booking/ ├── index.php # Landing page ├── user/ │ ├── search.php # Bus search page │ ├── book.php # Booking process │ ├── seat_selection.php # Choose seats (JS for interactivity) │ └── ticket.php # View/download ticket ├── admin/ │ ├── dashboard.php # Admin dashboard │ ├── add_bus.php # Add bus & schedule │ ├── manage_trips.php # Edit/delete trips │ └── special_trips.php # Add special buses ├── assets/ │ ├── css/ # Custom and Bootstrap CSS │ ├── js/ # JavaScript files for UI interactivity ├── db/ │ └── connection.php # DB connection script └── README.md


---

## ⚙️ How to Run Locally

1. **Install XAMPP/LAMP**:
   - Download and install [XAMPP](https://www.apachefriends.org/) (for Windows/Linux/macOS).

2. **Clone the Repository**:
   ```bash
   git clone https://github.com/yourusername/bus-ticket-booking.git
  1. Move to htdocs Folder (if using XAMPP):

    mv bus-ticket-booking /xampp/htdocs/
  2. Import Database:

    • Open phpMyAdmin at http://localhost/phpmyadmin.
    • Create a new database (e.g., bus_booking).
    • Import the provided SQL file (e.g., bus_booking.sql).
  3. Configure Database:

    • Edit db/connection.php to match your database credentials:

      $conn = new mysqli("localhost", "root", "", "bus_booking");
  4. Start the Server:

    • Open XAMPP Control Panel → Start Apache and MySQL.
    • Visit http://localhost/bus-ticket-booking in your browser.

✅ Future Improvements

  • Integrate a real payment gateway (like Razorpay or PayPal).
  • Add email notifications for booking confirmations.
  • Use AJAX for real-time seat updates.
  • Add user authentication and booking history.
  • Improve UI further with Bootstrap components and better UX.

📃 License

This project is licensed under the MIT License – feel free to use, modify, and distribute it with credit.


Made with care for seamless travel booking.


---

About

A dynamic bus ticket booking system using PHP, Apache, and MySQL. Users can search routes, choose seats, make payments, and download tickets. Admins can manage buses, schedules, and special trips.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •