A small PHP web application for reporting and managing road issues (potholes, hazards, etc.). This repository contains the FMR 2.0 web app built to run on a local PHP environment (for example XAMPP).
- Project overview
- Features
- Prerequisites
- Installation
- Configuration
- Database
- Running the app
- File structure
- PHPMailer / Email setup
- Development notes & tips
- Contributing
- License
FMR 2.0 is a PHP-based web application for users to report road issues and for administrators to manage reports. It's built with plain PHP and uses a MySQL database. The project is intended to run in a typical LAMP/WAMP stack — on Windows we recommend XAMPP.
- User signup, login, profile and report submission.
- Admin panel to list, review, update and manage reports.
- Email notifications (PHPMailer included under
model/PHPMailer). - Simple map integration (see
map.js) for report locations.
- Windows, macOS or Linux
- PHP 7.4+ (or compatible) with mysqli
- MySQL / MariaDB
- XAMPP (recommended for Windows) or equivalent local server
- Composer (optional, for PHPMailer updates)
- Place the project folder in your web server root. For XAMPP on Windows, copy the folder to
C:\xampp\htdocs\so the app is reachable athttp://localhost/FMR 2.0/. - Start Apache and MySQL in the XAMPP control panel.
- Import the database:
- Open
phpMyAdmin(http://localhost/phpmyadmin) - Create a new database (for example
fmr_db). - Import the SQL file
fixmyroad.sqlfrom the project root.
- Open
- Update the database credentials in
model/database.phpto match your MySQL user, password and database name.
model/database.php: set DB_HOST, DB_USER, DB_PASS, DB_NAME.model/email.php(andmodel/PHPMailerfiles): configure SMTP settings if you want outbound email. See the PHPMailer notes below.- If the project uses any hard-coded base URL, search for
http://references and update them for your environment.
The repository contains fixmyroad.sql in the project root — import this to create the tables and example data. After importing, ensure the database user has the required privileges.
- Ensure Apache and MySQL are running (via XAMPP).
- Open a browser and navigate to
http://localhost/FMR 2.0/(or the folder name you used). - Use the UI to register, login, and create reports. Admin interfaces are under
view/admin/.
index.php— main entry pagenavbar.php,sidebar.php— shared UI piecesmodel/— database, email, JS and helper codedatabase.php— DB connectionemail.php— email wrapperPHPMailer/— bundled PHPMailer library
controller/— controllers for admin, security, and user actionsview/— UI:admin/,security/,user/folders with pagesstyle/— CSS files used by the UIfixmyroad.sql— database dump for import
PHPMailer is included in model/PHPMailer. To enable sending email:
- Edit
model/email.phpor the file where SMTP is configured and provide SMTP host, port, username and password. - If using Gmail or other providers, ensure the account allows SMTP access (app passwords or OAuth may be required).
- (Optional) Run
composer installinsidemodel/PHPMailerif you want to manage dependencies via Composer (not required for the bundled files).
- Sanitize and validate user inputs in
controller/before using them in queries. - Consider moving DB credentials to an environment file (not committed to git) instead of keeping them in
model/database.php. - Ensure uploaded files (if any) are validated and stored outside web-root or with safe names.
If you'd like to add features or fixes:
- Fork the repository on GitHub.
- Create a branch:
feature/your-feature. - Make changes and test locally.
- Submit a pull request with a description of your changes.
Please include migration steps if your change modifies the DB schema.
This repository does not include an explicit license file. If you want to make the project open-source with a standard license, consider adding an LICENSE file (for example, MIT). If you'd like, I can add an MIT license file for you.