litasite

Ward Councillor Voting System

Reusable ward-based voting website built with PHP and MariaDB/MySQL.

The public pages use clean HTML structure. All voting, registration and admin logic still runs on the PHP backend for security.

Public pages

Page File Purpose
Home index.php Landing page
About about.php How the system works
Contact contact.php Contact form
Registration registration.php Voter registration request
Voting vote.php ID verification + cast vote
Admin Login login.php Administrator sign-in

Admin account safety (important)

Not anyone can become an admin.

  1. First admin – created only through setup.php (run once, then delete the file).
  2. Extra admins – created on admin-register.php only if the visitor knows the secret ADMIN_REGISTRATION_KEY stored in config.php.
  3. Change the key in config.php to a long private value and share it only with authorised people.
  4. Logged-in admins manage only their own ward.

This prevents open public registration of administrators.

How to run

  1. Install XAMPP (PHP + MariaDB/MySQL).
  2. Copy the WardVoting folder into C:\xampp\htdocs\.
  3. Start Apache and MySQL.
  4. In phpMyAdmin, import database/schema.sql.
  5. Open http://localhost/WardVoting/setup.php and create the first ward + admin.
  6. Delete setup.php immediately after.
  7. Change ADMIN_REGISTRATION_KEY in config.php.
  8. Sign in at login.php and start adding voters / nominees.

Project structure

WardVoting/
├── index.php, about.php, contact.php
├── registration.php, vote.php
├── login.php, admin-register.php, logout.php, setup.php
├── config.php, functions.php, style.css, .htaccess
├── admin/
│   ├── dashboard.php
│   ├── voters.php
│   ├── requests.php
│   └── election.php
└── database/
    └── schema.sql

Security notes