PHP
  Home arrow PHP arrow Page 4 - 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  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
Google.com  
PHP

Creating a Fraud-proof Voting System
By: Ian Felton
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 117
    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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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 - Trust but Verify
    ( Page 4 of 4 )

    Now that there is a vote in the system, we need a simple verification script that will determine if the vote is legitimate. We’ll call this script, Verify.php. It looks like this:

    //Select the database
    mysql_select_db($database, $db);
    //Update the record to set the Boolean flag to true if the timestamp in the verification email matches the timestamp in the database record.
    $selectSQL = sprintf("UPDATE votes set pending=1 where bandID=%s AND email=%s AND time=%s", GetSQLValueString($_GET['band'], "int"),
    GetSQLValueString($_GET['email'], "text"),
    GetSQLValueString($_GET['time'], "text"));
    $Result2 = mysql_query($selectSQL, $UB_DATA);
    //Message for voter.
    $messages = "Thanks for voting. Remember, you can only vote once a day for a band , but you can vote for as many bands a day as you want.";

    This completes the general design of a fraud-proof voting system. There are a few ways to get around this system. ‘Fraud-proof’ is used in the general sense. Dick could obviously go around from computer to computer in the White House and keep voting for his favorite band. There’s some other ways around this system too, but I’ll let you figure that out. However, with this basic design, a voting system that prevents the basest level of fraud can be setup to your specific purpose relatively simply. Happy voting



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

       

    PHP ARTICLES

    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek