Home arrow PHP arrow Creating a Fraud-proof Voting System

Creating a Fraud-proof Voting System

Setting up polls or voting systems is a great way to get users more involved in your website, and keep them coming back for more. But with fraud hanging over the professional political elections, how do you keep your visitors from screaming for a recount--or worse, stuffing the ballot box? Ian Felton describes a simple system for setting up an online poll and preventing abuses.

  1. Creating a Fraud-proof Voting System
  2. One Person, Multiple Addresses, Still One Vote
  3. One Vote.php, Two States
  4. Trust but Verify
By: Ian Felton
Rating: starstarstarstarstar / 143
December 21, 2004

print this article



John Kerry just called. He said the election was full of fraud. Votes were lost. Some were torn up. A nice little old church lady tore mine right in front of me; all for the good of the cause. Fraud plays a huge role in elections, but we programmers want better than that. A fraud-proof voting system can help ensure that the outcome of polls or contests on your site are evidence of what voting is about, determining popular demand.

At United Bands (http://unitedbands.com/), I run a monthly contest. Fans come to the site and vote for songs they would like to hear on the United Bands play list. The obvious purpose of the system is to determine which songs people like and want to hear more often. Without a fraud-proof system though, skewed results are the norm.

When a fan browses the band profiles at United Bands, they listen to songs and vote for songs they like. If the system was so basic as to let users just click a button to vote, some people would click it all day or set up a script to run and cast millions of votes for the same song. This type of fraud needs to be eliminated to make the feature enjoyable for people other than those with too much time on their hands or the know-how to run an automated script.

The process for voting at United Bands is simple enough. Fans can click a link on bandsí profile pages, then enter an email address. If the address and vote are legitimate, it counts as a vote. What is a legitimate vote? Fans are allowed to vote for an individual song once per day. However, the same person can vote for as many songs as they like. So Dick Cheney, or Dick, as I like to call him can come to the site and vote for his favorite band, Vibralux Trans-Mission (http://www.unitedbands.com/bands/Vibralux_trans-mission/), one time on Monday, one time on Tuesday and so on. He can also vote for other bands each day, but again, only one vote per day for each individual band. When Dick submits the form, an email is sent to his posted email address. When Dick checks his email, he clicks the URL in the email as verification of his vote. Then the vote is counted.

>>> More PHP Articles          >>> More By Ian Felton

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: