A small dynamic and static website showcasing Belgian cities, monuments, and useful links — built with HTML, CSS, JavaScript, PHP, and (optionally) Hack/HHVM. Developed a newsletter system and implemented database connectivity using MySQL and XAMPP to enhance interactivity and data management. This README provides clear development, run, and contribution instructions to help you get started quickly. 🚀
- About
- Features
- Tech Stack
- Repository Structure
- Prerequisites
- Quick Start — Static
- Quick Start — PHP Backend
- Quick Start — Hack / HHVM Backend
- Recommended Improvements
- Contributing
- Security
- License
- Contact
This project contains a website about Belgium with multiple HTML pages (city pages, monuments, projects, useful links, contact page) and a dynamic portion in the Partie_dnamique/ directory. It is intended as a demo or learning project and can be used as a lightweight informational site.
- Static pages for cities, monuments, and projects 🏙️
- Contact page with form (requires backend handling to process submissions) ✉️
- Image assets and CSS styling 🎨
- Server-side code present in
Partie_dnamique/(PHP and possibly Hack/HHVM) ⚙️
- HTML5
- CSS3
- JavaScript (vanilla)
- PHP (standard)
- Hack (HHVM) — optional, only if using Hack files in the dynamic folder
- Optional: GitHub Pages for static hosting 🌐
High-level layout:
- /.vscode/ — editor settings (optional)
- /Partie_dnamique/ — dynamic/backend code (PHP/Hack)
- /css/ — stylesheets
- /js/ — JavaScript files
- /img/ — image assets
- index_projet.html — project index page
- index_ville.html — city index page
- site_monument.html — monument page
- contact.html — contact page
- lien_utile.html — useful links page
- nous_info.html — about / info page
- README.md — this file
Choose one runtime depending on whether you want to run static pages, PHP, or Hack:
-
Static pages:
- Any modern browser
- (Optional) Python or Node for a local static server
-
PHP backend:
- PHP 7.4+ installed (https://www.php.net/)
- (Optional) Composer if you add dependencies later
-
Hack / HHVM backend:
- HHVM installed and configured (https://docs.hhvm.com/)
- Hack files require HHVM and cannot run on standard PHP
-
Clone the repository:
git clone https://github.com/abdessamad-chahbi/belgium-dynamic-website.git cd belgium-dynamic-website -
Serve locally with Python:
python3 -m http.server 8000 # Open http://localhost:8000/index_ville.html or index_projet.html -
Or serve with Node (serve):
npx serve .
This is the easiest way to preview static HTML/CSS/JS pages.
If the contact form or other pages require PHP processing:
-
Ensure PHP is installed:
php -v
-
Run the built-in PHP server from the project root:
php -S 127.0.0.1:8000 # Visit http://127.0.0.1:8000/contact.html or the page that posts to PHP handlers -
Update form actions to point to the correct PHP endpoints (e.g.,
/Partie_dnamique/process_form.php). -
Recommended: Use a
.envor config file for sensitive settings and add it to.gitignore.
If the project uses Hack files in Partie_dnamique/, HHVM is required.
-
Install HHVM: follow instructions at https://docs.hhvm.com/
-
Serve the project with HHVM (example command — consult HHVM docs for your version):
hhvm -m server -p 8080 -d hhvm.server.source_root=$(pwd) # Then open http://localhost:8080/
-
Verify Hack files use the
<?hhheader and that routes point to HHVM handlers.
- Add input validation and server-side sanitization for forms (security) 🔒
- Add linters and GitHub Actions for basic checks (HTML/CSS/JS, php -l) ⚙️
- Optimize images (compress, consider WebP) and minify assets for performance 🖼️
- Improve accessibility (alt attributes, semantic HTML, ARIA where needed) ♿
Contributions are welcome! Suggested workflow:
- Fork the repository
- Create a feature branch:
git checkout -b feature/short-description
- Make changes, commit with clear messages:
git commit -m "feat: add X" - Push and open a Pull Request
- Do not commit secrets (API keys, passwords). Use environment variables or
.envand add.envto.gitignore. - Validate and sanitize all user input server-side.
- Escape output to prevent XSS. Use prepared statements for database interactions to prevent SQL injection.
- Avoid exposing debug information in production.
This repository currently does not include a license file. It is recommended to add a LICENSE (for example, MIT) to clarify reuse and distribution rights. 📜
Owner: abdessamad-chahbi
GitHub: https://github.com/abdessamad-chahbi
Thank you for visiting this project! 🙌