PHP
  Home arrow PHP arrow Page 2 - Creating a Fraud-proof Voting System
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Creating a Fraud-proof Voting System
By: Ian Felton
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 102
    2004-12-21

    Table of Contents:
  • Creating a Fraud-proof Voting System
  • One Person, Multiple Addresses, Still One Vote
  • One Vote.php, Two States
  • Trust but Verify

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating a Fraud-proof Voting System - One Person, Multiple Addresses, Still One Vote


    (Page 2 of 4 )

    Sending the email is only the first step for fraud prevention because some people have a thousand email addresses. Someone could (and would) vote for the same song using all of their email addresses and skew the results in that way. Because of situations like that, the system also needs to verify that fans aren’t using multiple email addresses. The verification email also needs some sort of key so that the verification script cannot be easily hacked.

    Two scripts comprise the bulk of the system. One script, vote.php, casts the vote and sends the verification email. Another script, verify.php sets the vote as valid after Dick clicks the link in his inbox. A table in the database will need to be created to store votes.

    First, we’ll setup the table in the database to store the votes that are cast. We need a basic primary key called ID. We’ll store the email address of the voter. We’ll timestamp the vote. We need a column that shows whether the vote has been verified. It will be a Boolean flag. We’ll store the ID of the band receiving the vote. We’ll store the song name and finally the IP address of the voter.

    CREATE TABLE `votes` (
    `ID` int(10) unsigned NOT NULL auto_increment,
    `email` varchar(255) NOT NULL default '0',
    `time` timestamp(14) NOT NULL,
    `pending` tinyint(1) unsigned NOT NULL default '0',
    `bandID` int(10) unsigned NOT NULL default '0',
    `song` varchar(255) default NULL,
    `IP` varchar(15) NOT NULL default '0',
    PRIMARY KEY (`ID`),
    UNIQUE KEY `ID` (`ID`),
    KEY `ID_2` (`ID`)
    ) TYPE=MyISAM AUTO_INCREMENT=0;

    More PHP Articles
    More By Ian Felton


       · You describe as most important requirement of the example that users shall not be...
       · Yup, that's pretty much what they are doing- not allowing folks from the same IP...
       · ... a NOT foolproof way of checking votes, and the only thing unusual from the...
       · "NOTHING is foolproof to a sufficiently talented fool!"
       · I agree. Using a user's IP address as a means of verifying the user, is a classic...
       · "There are a few ways to get around this system. ‘Fraud-proof’ is used in the...
       · That Jeb Bush is governor of Florida does not imply the 2000, or 2004 election was...
       · Thank you.
       · Yes of course, Florida was on the up and up. Katherine Harris, the state's chief...
       · 1 ip 1 vote is an unacceptable requirement for most websites. Sure, it will help...
       · You must surely be right to call this man a moron...In fact, Diebold's CEO DIDN'T...
       · Well, a Democrat, Chad Staton, linked to the NAACP attempted to register George...
       · Creating ballots - no. Removing large numbers of (mainly Democrat) ballots - yes....
       · A governor does not have the power to do that. A governor signs his state's...
       · How come there is no response? Talk about loooooozah! Democrats are whiny pathetic...
       · Peyton, you are really a moron. Good there are people like you to belive on...
       · Let's call each other names now, shall we?I am still interested in how Governor...
       · Can't we all just get along?
       · I second that.
       · http://www.gregpalast.com/detail.cfm?artid=27&row=2The powers in Florida simply...
       · [url=http://archives.cnn.com/2002/ALLPOLITICS/05/28/justice.florida.voting]Read this...
       · What does this have to do with the article?
       · At one time WebTV gave all users one of a handful of IP addresses.Poor WebTV...
       · I've always thought it was funny that just because Bush won Fl and his brother...
       · You should make this voting system as a download...like a zip or something. It...
     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT