CF Polling v0.94 script

A easy-to-use polling script using ajax and php,requires no configuration and works with flat file database. Website polls are a easy way to get feedback from your site visitors.

Look & Feel
It's easy to change the look of the poll by using CSS, below you will see some examples of different looks.

Time Limit
You can set the number days you would like your poll to run for.
New 0.92 You can now set the date you would like the poll to end.

One Vote
One of the options available is the ability to enable one vote per IP, meaning when you're users vote their IP address is saved to prevent multiple voting.
New 0.93 Now the script can use cookies as well as the IP address logging to help prevent multiple votes by people with dynamic IP's address.
16 March 2011
0.94 - CF Polling Now uses Ajax to post a votes.

30 December 2010
0.93 - Added a new Option (On by default) the script can use cookies as well as the IP address logging to help prevent multiple votes by people with dynamic IP's address. You can turn cookies off by using setCookieOff(); before one_vote().

28 December 2010
0.92 - Added a new Option to set the end date for the poll, you can see it being used in Example 3 - endPollOn(day,month,year)

10 June 2010
0.91 Fix - script was not letting you add new answer to polls what had been started..
Please make sure that the folder "polls" in folder "cfPolling" is writable (chmod 777).

Example CF Polling v0.94

Example 1

Results

Poll closed on 24 Mar 14
What do you think about this site?
41%
25%
13%
10%
11%
<?php
// include the cf polling class file
    
include('cfPolling/cf.poll.class.php');

// your poll question
    
$poll_question ='What do you think about this site?';

// In this variable you can enter the answers (voting options),
// which are selectable by the visitors.
// Each vote option gets an own variable. Example
    
$answers[] = 'Good';
    
$answers[] = 'Excellent';
    
$answers[] = 'Bad';
    
$answers[] = 'Can Be Improved';
    
$answers[] = 'No Comment';

// Make new poll
    
$new_poll = new cf_poll($poll_question,$answers);

// (Option)
// if you do not want to use cookies to log if a user has voted.
// if you are not using one_vote there is no need to use this.
//    $new_poll -> setCookieOff(); //(new 0.93)

// (Option)
// One vote per ip address (and cookies if not off)
    
$new_poll -> one_vote();

// (Option)
// Number of days to run the poll for
    
$new_poll -> poll_for(100);// end in 100 days
//    $new_poll -> endPollOn(02,03,2010);// (D,M,Y) the date to end the poll on (new 0.92)

// (Option)
// Set the Poll container id (used for css)
    
$new_poll -> css_id('cfpoll1');

// chack to see if a vote has been cast
// used if the user has javascript off
    
$new_poll -> new_vote($_POST);

// echo/print poll to page
    
echo $new_poll -> poll_html($_GET);
?>
Example 2

Vote

What do you think about this poll?
<?php
    
include('cfPolling/cf.poll.class.php');
    
$poll_question2 ='What do you think about this site?';
    
$answers2 = array('best!','ok!','bad!');
    
$new_poll2 = new cf_poll($poll_question2,$answers2);
    
$new_poll2 -> new_vote($_POST);
    echo 
$new_poll2 -> poll_html($_GET);
?>
Example 3

Results

Poll closed on 25 Dec 14
How many hours a week do you spend in front of a computer?
31%
27%
20%
22%
<?php
    
include('cfPolling/cf.poll.class.php');
    
$poll_question3 ='How many hours a week do you spend in front of a computer?';
    
$answers3 = array('Less then 10''Between 10 abd 20''Between 20 abd 50''More then 50 hours');
    
$new_poll3 = new cf_poll($poll_question3,$answers3);
    
$new_poll3 -> setCookieOff();
    
$new_poll3 -> one_vote();
    
$new_poll3 -> endPollOn(25,12,2011);
    
$new_poll3 -> css_id();
    
$new_poll -> new_vote($_POST);
    echo 
$new_poll3 -> poll_html($_GET);
?>

Download

Last Updated : 16 March 2011
0.94 - CF Polling Now uses Ajax to post a votes.

Download : CF Polling Version 0.94

Like our script? Rate it at PHP > Hot Scripts
If you find any bugs please let me know or if you need any help please feel free to post a coment below and I will answer you as soon as possible.

Information: Comments are closed. Please use the new forum
Other Tools
CF Captcha 0.9
A Simple PHP Anti-Spam Captcha Script based on PHP/GD, to help prevent web robot from...
CSS Font Style Generator
This online tool allows you to experiment with the CSS font properties and text styles....
Page Back - Forward Buttons
Navigation back and forwards form a web page without using the browser buttons.
Forum Topics
I can not use: Mod_rewrite
I want to use real photos link. I have enabled: Mod_rewrite but still not successful and meet some of the...
Here is Practical Explanation about Next Life, Purpose of Human Life -
Practical Explanation ( For Example ) :- `1st of all can you tell me every single seconds detail from that...
direct link doesnt work
hi, i have this odd problem, when choosing direct link from the image sharing links, it shows cant open...
split sitemap into multiple .xml files
Google only likes each xml sitemap to contain 50,000 links max. This is a problem for me. Sitemap increased...
Max size allowed
Sorry, the image size is to big,3300x3300 is the Max size allowed. как-то...