Voting System using PHP/MySQLi with Source Code

Language

The Voting System web application using PHP/MySQLi is a project that serves as the automated voting system of an organization or school. This system works like the common manual system of election voting system whereas this system must be populated by the list of the positions, candidates, and voters. This system can help a certain organization or school to minimize the voting time duration because aside they can provide the voters an online platform to vote, the system will automatically count the votes for each candidate. The system has 2 sides of the user interface which are the administrator and voters side. The admin user is in charge to populate and manage the data of the system and the voter side which is where the voters will choose their candidate and submit their votes.

Features:

  • Vote preview
  • Multiple votes
  • Result tally via Horizontal Barchart
  • Print voting results in PDF
  • Changeable order of positions to show in the ballot
  • CRUD voters
  • CRUD candidates
  • CRUD positions

Plugins

  • AdminLTE
  • TCPDF

Installation

  1. Download the source code using the Download button below.
  2. Extract the downloaded file to your localhost folder ex. htdocs for XAMMP.
  3. Import the included .sql file located in db folder which is the database of the system. If you have no idea how to import, please refer to my tutorial on How import .sql file to restore MySQL database.
  4. After a successful import, open the extracted folder and open conn.php in both the includes folder and in the admin/includes folder. Edit the database name in the connection depending on the name of the database you created in importing the included .sql file.

How to Use

  1. First login as administrator by adding /admin/ in the URL. You should be redirected to the admin login page.
  2. Add the important data such as positions, candidates, and voters.
  3. Change the title of the election by clicking the Election Title menu.
  4. Rearrange the order of positions depending on the desired order to show in the ballot using the Ballot Position menu.

Use this admin credential:

Username: nurhodelta
Password: password

And for the voter's username, use the auto-generated voter's id.

That's it. If you find any bugs or errors or you have any suggestions, comments, or reactions, feel free to comment below or message me.

Happy Coding :)

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

hey Neo saw your system is good but i fail to login into voters because i fails to identify votersid. need your help

am very surprise and impressed when i go through this project. Good job (please i want to learn more from you.)

Haven't seen the code yet

I CAN'T PRINT THE RESULT OF THE ELECTION COULD YOU HELP ME PLEASE Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\htdocs\VotingSystem_PHP\votesystem\tcpdf\tcpdf.php on line 17778 TCPDF ERROR: Some data has already been output, can't send PDF file

easy code is fast

i need voting system with php
very usefull

I'm having an error in the print button particularly in "each" code, do you have any suggestions or workaround? Thank you

Hello, am getting this error when trying to log in as admin. Please help Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\votesystem\admin\includes\conn.php on line 3 Connection failed: Access denied for user 'root'@'localhost' (using password: NO)

PLEASE HOW DO I GET AND ADD THE PLUGINS, AND ALSO CAN I IMPORT VOTERS, IF YES THEN HOW

Cant login with this user details Nurhodelta password

Can't login with nurhodelta and password credentials. Kindly help.

Hello, am having the same problem, how did you manage to log in? Kindly assist, [email protected].

I cannot log in using the username and password. it brings error message. Kindly assist.

I really take this chance to appreciate you for your work to put up this system. It is good and works efficiently well. To any one downloading it, you might need to update the tcpd to the current version to allow printing.

In reply to by Reagan Ahimbisibwe (not verified)

Hi Reagan, Thank you for the useful advice. Just one question. Do I have to download it separately and plug it into my code files, replacing the old one?Or how is one to go about it?

Hi Nurhodelta, Thank you for this amazing project. It has been really helpful in my class project. However, I am having issues printing the votes. I get a deprecated and warning error message from the following lines: Warning: chr() expects parameter 1 to be int, string given in C:\wamp64\www\votesystem\tcpdf\include\tcpdf_fonts.php on line 1671 Deprecated: The each() function is deprecated. This message will be suppressed on further calls in C:\wamp64\www\votesystem\tcpdf\tcpdf.php on line 16542 Warning: Cannot modify header information - headers already sent by (output started at C:\wamp64\www\votesystem\tcpdf\tcpdf.php:16542) in C:\wamp64\www\votesystem\tcpdf\tcpdf.php on line 7624 Kindly assist me rectify this error. I am very greatful. Best regards, Hassan

Using wammp server, you can downgrade your php version if it is higher. i was using version 7.4.26 and I faced deprecation problems. So i downgraded to PHP version 5.6.40 and it works smooth like a baby.

Nurhodelta, how do I import multiple voters details via excel or cvs to the source code

Thank you hope i can edit the code and customize it, and admin login is not working please where is the password hash available

GREAT AND PERFECT WORK DONE HERE BUT THE SCRIPT DOESENT WORK ON LIVE SEVER [email protected]

Add new comment