Home arrow PHP arrow Page 2 - Democracy, The PHP Way

The Plan - PHP

One of the simplest and most popular add-ons to a Web site is anonline poll, allowing visitors to vote on hot-button issues. In thisarticle, find out how PHP can be used to build a powerful, good-lookingonline poll for your Web site, and also learn a little bit about its imageand cookie manipulation functions.

TABLE OF CONTENTS:
  1. Democracy, The PHP Way
  2. The Plan
  3. Design View
  4. Start Me Up
  5. Vote Now, Or Forever Hold Your Peace
  6. The Number Game
  7. Down Memory Lane
  8. Cookie-Cutter Code
  9. Adding More...
By: Vikram Vaswani, (c) Melonfire
Rating: starstarstarstarstar / 24
April 16, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
The first order of business is to decide the features to be supported by this application. Obviously, there needs to be a mechanism by which the user can view a question, and then select from a list of possible answers. Once the "vote" has been captured, it's traditional to offer the voter an opportunity to look at the results generated thus far.

For purposes of this tutorial, I'll assume that each poll consists of a single question, with three possible responses.

So far as the results are concerned, it's quite easy to provide a tabular report of the votes for each possible option. However, I plan to make the application look more professional by providing a graphical report, in the form of a bar graph. This might seem difficult to do, since the graph would need to be dynamically generated depending on the votes, but PHP's image generation functions make it a snap.

A quick review of the various Web portals suggests that most of them also allow visitors to view the results of previous polls (this is particularly useful if the poll question changes on a daily basis). This is not too difficult to do - so let's add that to the feature list as well.

With this skeleton in mind, the next step is to design a database that supports these requirements.

This article copyright Melonfire 2001. All rights reserved.

 
 
>>> More PHP Articles          >>> More By Vikram Vaswani, (c) Melonfire
 

blog comments powered by Disqus
   

PHP ARTICLES

- 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...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


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

Dev Shed Tutorial Topics: