Database Articles

  Home arrow Database Articles arrow Page 6 - Adding a Poll to Your Web Site
DATABASE ARTICLES

Adding a Poll to Your Web Site
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 203
    2005-06-29

    Table of Contents:
  • Adding a Poll to Your Web Site
  • Setting the Stage
  • Creating the Form
  • The Complete showvotes.php
  • Expanding the Poll
  • Polling Accuracy

  •  
     

    SEARCH CODEWALKERS

    Adding a Poll to Your Web Site - Polling Accuracy


    (Page 6 of 6 )

    It's a fact: Web poll results are not an accurate reflection of the population at large. First, many people choose not to participate in polls, and there's nothing you can do to change that. Second, some people will try to skew the results by casting multiple votes. There are ways to limit users to one vote, but determined users can get around all of them.

    You can set a cookie whenever a user casts a vote, but there are two problems with this: 1) Some users disable cookies, and 2) Some users regularly clear their cookies. So some people will be unable to vote, while others will be able to vote more than once after clearing their cookies.

    You could also log the IP address of each visitor, and allow only one vote from each address. Once again, there are two problems: 1) Some users share a machine with other users, or have access only through public machines, and 2) Some users have access through multiple IPs, for example, at home and at work. Users with dialup connections may be assigned a different IP address each time they connect. Once again, some users will not be able to participate, and others will still be able to vote more than once.

    You might force users to register their email address and log in before voting. Then you could add another table to the database to track which polls each user has voted. Again, there are two problems: 1) Some users will not want to bother with setting up an account just to vote in a poll or will not want to give out their email address, and 2) Some users will use multiple email addresses to beat the system and vote more than once.

    There's no sure way to keep a determined user from skewing the poll results. So take polls for what they are worth and don't put too much stock in their results. Done right, a poll can be an easy way to let visitors interact with your site, and it's usually more fun than getting bitten by a ferret.

    About the Author

    Bruce Alderman is a Systems Specialist by day and a freelance writer by night, yet he still manages to find time for hobbies like PHP programming. He lives in Wichita, Kansas. He has never been bitten by a ferret, but it's on his list of things to do.

    Acknowledgement

    Thanks to Lawrence Pires for pointing out a couple of errors. They have been fixed. -Ed


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.
    blog comments powered by Disqus

    DATABASE ARTICLES ARTICLES

    - MariaDB, a MySQL Alternative, Opens Foundati...
    - Oracle Supporting HP Itanium Again, Finally
    - Completing a Book Inventory Management System
    - Uploading Images for a Book Inventory Manage...
    - Finishing the Add Book Story for a Book Inve...
    - Integration Testing for a Book Inventory Man...
    - User Stories for a Book Inventory Management...
    - Unit Testing a Book Inventory Management Sys...
    - Testing a Book Inventory Management System
    - Implementing Models for a Book Inventory Man...
    - Book Inventory Application: Publishers and B...
    - Handling Publishers in a Book Inventory Mana...
    - Publisher Administration for Book Inventory ...
    - Book Inventory Management
    - Using the SQL Reference Manual

    Developer Shed Affiliates

     



    © 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap