A secure and modern online voting app built using PHP and MySQL, running on XAMPP. It allows users to vote online with real-time results. Admins can easily manage elections, candidates, and voters.
Before you start, make sure youβve got:
- β XAMPP (PHP 7.4+ & MySQL)
- β Any modern web browser
- β Git (optional, for cloning)
git clone https://github.com/Ayushkumar418/VotingSystem.git
cd VotingSystem# For Windows users
xcopy /E /I VotingSystem C:\xampp\htdocs\VotingSystemcp config/database.example.php config/database.phpcopy config\database.example.php config\database.phpThen edit config/database.php with your MySQL DB details:
$host = 'localhost';
$dbname = 'voting_system';
$username = 'root';
$password = ''; // Default is blank in XAMPP-
Create a new database:
voting_system -
Import the following SQL files:
sql/setup.sqlsql/update.sql(updates, if any)
-
Main Site: π http://localhost/VotingSystem
-
Admin Panel: π http://localhost/VotingSystem/admin
Email: admin@system.com
Password: admin123
To check if everything is set up correctly:
- Visit http://localhost/VotingSystem/install.php
- This will show you:
- β PHP Version compatibility
- β MySQL connection status
- β Required directory permissions
- β Required PHP extensions
If you see any β errors, fix them before using the system.
- π₯ Voter Registration & Login
- π³οΈ Secure One-Time Voting
- π Real-Time Result Display
- π Admin Panel (Manage Elections, Candidates, Voters)
- π Export Results (Excel)
- π Activity Logs
- Password Hashing
- Session Management
- Input Validation
- XSS Protection
- CSRF Tokens
VotingSystem/
βββ admin/ # Admin dashboard
βββ config/ # DB config files
βββ includes/ # Reusable PHP functions
βββ sql/ # DB setup scripts
βββ uploads/ # Candidate images
βββ vendor/ # Third-party dependencies
Cool! Here's how:
- π Fork this repo
- π οΈ Create a new branch
- β¨ Add your changes
- π Push the branch
- π¬ Open a pull request
Made with β€οΈ by Ayush Kumar