Skip to content

Latest commit

Β 

History

History
152 lines (102 loc) Β· 3.02 KB

File metadata and controls

152 lines (102 loc) Β· 3.02 KB

πŸ—³οΈ Online Voting System

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.


βš™οΈ Requirements

Before you start, make sure you’ve got:

  • βœ… XAMPP (PHP 7.4+ & MySQL)
  • βœ… Any modern web browser
  • βœ… Git (optional, for cloning)

πŸš€ Setup Guide (Localhost using XAMPP)

1️⃣ Clone the Project

git clone https://github.com/Ayushkumar418/VotingSystem.git
cd VotingSystem

2️⃣ Move It to XAMPP's htdocs Folder

# For Windows users
xcopy /E /I VotingSystem C:\xampp\htdocs\VotingSystem

3️⃣ Set Up Database Config File

πŸ”Ή For Git Bash / Linux / macOS:

cp config/database.example.php config/database.php

πŸ”Έ For Windows CMD:

copy config\database.example.php config\database.php

Then edit config/database.php with your MySQL DB details:

$host = 'localhost';
$dbname = 'voting_system';
$username = 'root';
$password = ''; // Default is blank in XAMPP

4️⃣ Set Up the Database

  1. Open http://localhost/phpmyadmin

  2. Create a new database: voting_system

  3. Import the following SQL files:

    • sql/setup.sql
    • sql/update.sql (updates, if any)

5️⃣ Run the Project

πŸ§‘β€πŸ’Ό Default Admin Login:

Email:    admin@system.com  
Password: admin123

6️⃣ Verify Installation

To check if everything is set up correctly:

  1. Visit http://localhost/VotingSystem/install.php
  2. 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.


πŸ”₯ Key Features

  • πŸ‘₯ Voter Registration & Login
  • πŸ—³οΈ Secure One-Time Voting
  • πŸ“ˆ Real-Time Result Display
  • πŸ’  Admin Panel (Manage Elections, Candidates, Voters)
  • πŸ“„ Export Results (Excel)
  • πŸ“œ Activity Logs

πŸ›‘οΈ Security Features

  • Password Hashing
  • Session Management
  • Input Validation
  • XSS Protection
  • CSRF Tokens

πŸ“ Folder Structure

VotingSystem/
β”œβ”€β”€ admin/           # Admin dashboard
β”œβ”€β”€ config/          # DB config files
β”œβ”€β”€ includes/        # Reusable PHP functions
β”œβ”€β”€ sql/             # DB setup scripts
β”œβ”€β”€ uploads/         # Candidate images
└── vendor/          # Third-party dependencies

🀝 Wanna Contribute?

Cool! Here's how:

  1. 🍝 Fork this repo
  2. πŸ› οΈ Create a new branch
  3. ✨ Add your changes
  4. πŸš€ Push the branch
  5. πŸ“¬ Open a pull request

Made with ❀️ by Ayush Kumar