This project is a university-level web application built with PHP and PostgreSQL. It simulates an online car rental platform themed around Fast & Furious vehicles.
Users:
- Create an account and log in
- Search and rent cars for selected date ranges
- View their own reservations
Administrators:
- Add, delete, hide or show cars in the system
- View cars that have been rented
- Access usage statistics for the platform
- PHP (vanilla) – Backend logic
- PostgreSQL – Database system
- HTML/CSS/JavaScript – Frontend UI and form validation
- XAMPP – Apache server environment (on Windows)
- XAMPP: https://www.apachefriends.org/index.html
- PostgreSQL: https://www.postgresql.org/download/windows/
- A code editor (e.g., VS Code, Notepad++)
- Download and install XAMPP
- During setup, ensure Apache and PHP are selected
- Install to the default path:
C:\xampp
- Download PostgreSQL from the official website
- Install it and remember:
- Default user:
postgres - Default port:
5432 - Set a secure password (e.g.,
postgresfor development)
- Default user:
- Open
C:\xampp\php\php.iniin a text editor - Find and uncomment these lines by removing the semicolon (
;):extension=pgsql extension=pdo_pgsql - Save the file
- Restart Apache via the XAMPP Control Panel
- Copy your project folder (e.g.,
fast_furious_cars) into:C:\xampp\htdocs\ - Example final path:
C:\xampp\htdocs\fast_furious_cars\index.php
- Open pgAdmin or use the
psqlterminal - Create a new database:
CREATE DATABASE fastcars;
- Create the required tables and optionally insert data
(Use a SQL dump file likeschema.sqlif available)
In your PHP scripts, such as index_scriptForm.php, ensure your PostgreSQL connection string matches:
$connection = pg_connect("host=localhost dbname=fastcars user=postgres password=postgres port=5432");Replace the database name, user, and password as needed.
- Start Apache from the XAMPP Control Panel
- Visit the application in your web browser:
http://localhost/fast_furious_cars/
You can create a simple test file (test_pg.php) to verify the database connection:
<?php
$conn = pg_connect("host=localhost port=5432 dbname=fastcars user=postgres password=postgres");
if ($conn) {
echo "Connected to PostgreSQL!";
} else {
echo "Connection failed.";
}
?>Open this file in your browser at:
http://localhost/fast_furious_cars/test_pg.php
fast_furious_cars/
│
├── index.php
├── index_scriptForm.php
├── checkSession.php
├── create_uniqueID.php
├── user_selectCar.php
├── login.php
├── logout.php
├── register.php
├── admin_visualizeAllCars.php
├── style.css
├── javascript/
│ └── dateInputFormatter.js
├── schema.sql (optional)
└── README.md
- The default language of the website is Portuguese (
lang="pt") - Session-based logic handles user and admin roles
- Credentials and sensitive configuration should be secured for production
- Ensure PostgreSQL is running when accessing pages that query the database
This project was developed as part of a university assignment.
Contributors:
- Silas Sequeira
- Sam-Coelho