Simple Voting System
Submitted by rinvizle on Monday, July 11, 2016 - 08:25.
This tutorial will teach you how to create a simple voting system in PHP. And it has a two user side, the student and the admin, for the student side is were the user vote there candidate while for the admin is the control unit of the system that can edit, update, and see the results or count of all the candidates. This simple voting system is creating a vote candidates and position, and it generates result for all the candidates that the user voted.
Hope you learn it and enjoy coding. Thanks.
Sample Code
Script for the Vote Process- <?php
- {
- {
- {
- $position = $_POST['position_' . $row['position_id']];
- mysql_query("INSERT INTO votes (candidate_id,student_id) VALUES ('$position','".$_SESSION['student_id']."')") or die(mysql_error());
- }
- }
- $_SESSION['checkVote'] = 1;
- }
- ?>
Comments
Add new comment
- Add new comment
- 457 views