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