Ajax Poll Script
Address Book Script
Form2DB
PayPal IPN + eProduct Delivery Script
Lead Follow-Up Database Script
Ajax ContactUs Script
AdFreely -Ad Board Script-
Text Ad Script
Ajax Likes Script
Fade-In Slideshow
URL Shortening Script
Ajax Poll Admin
Fileup Addon

Ajax Poll Script

Ver 3.02
APSMX-302

( Required PHP version >= 5.2 )

Download

This is a free ajax poll script ( PHP + jQuery ). You can display polls and the results on any HTML pages. ( pages don't have to be PHP ) Ajax Poll Script displays poll results on the same page without moving to another page, saves poll results on flat files and hence does not require any databases. No restrictions on the poll style. HTML+PHP templates allow you to freely create your own style of online polls.
Easy installation: Just upload the script to your web site!
Easy integration: Add three lines of code to your web page and your poll shows up!
A single installation allows you to create multiple polls.
Multiple polls with different styles can coexist on a single web page.
Create multiple instances of the same poll with different data sets ( vote counts )
Prevent users from voting more than once by IP address and Cookie.
Can allow voters to select multiple options.
Specify starting time to open poll automatically. v3.02 <New!>
Specify ending time to close poll automatically. v3.02 <New!>
Variable-width design: Can expand to the outer container. Fits your page layout easily. v3.02 <New!>
Remembers and highlights the option you voted for. v3.02 <New!>
Can run PHP code in poll templates, which opens up unlimited possibilities!

Demo
The following demos are configured to prevent you form voting more than once. To go around the restriction, click "Reset IP & Cookie Block" button. Then you'll be able to vote again. When you put polls on your web page, you should of cource remove the button. It's quite easy to remove it.

License

GPL

Installation Guide

Quick Feedback to Tom, the developer

If you have any suggestions or find any problems, please leave them as a comment down below. we'd appreciate the feedback!

Name:
Subject:
Comment:
Email: (Will not appear online)
Posted by Peter
1475175142

Hi,

Very nice script.

Is-it possible to ask many questions in one poll ?

Could you help me?

Best regards
Posted by Rick
2016-09-09

Hi, Is it possible to make the poll show results with differing content.

Example:
User A clicks on poll A, response X = results of poll A appear with additional content 1. User B clicks on poll A, ... Read More
Posted by Tom
2016-09-10

Hi,

>Is it possible to make the poll show results with differing content.

I'm still not sure about the details of your spec but it sounds possible. Since it's open source, feel free to modify it!
Posted by John Kraus
2016-07-10

thx Tom

play around - and it works fine.

will alternate later

http://2-0-0-0.com/truepoll/

best, John
Posted by Tom
2016-07-10

You are welcome :)
Posted by RobD
2016-07-07

Tom, would it be feasible for you to update your poll script, for the sake of new users who would like the W3C validator be happy?

I think this is a great script and it deserves to be kept ... Read More
Posted by Tom
2016-07-09

Hi RobD,
Well, this is not really technical problem. From my past experences, I can tell this type of modifications will confuse the users greatly. Probably I shouldn't do it unless I had chance to ... Read More
Posted by Andy
2016-07-03

I will contact my web hosting company to fix it. Thank you very much.
Posted by Tom
2016-07-05

You are welcome!
Posted by Andy
2016-07-02

Thank you for your reply. The hard coded value is working for the polls. Yes, I want to fix the server. Do you know how to fix my server which is returning a wrong domain in $_SERVER["SERVER_NAME"]? ... Read More
Posted by Tom
2016-07-03

>Do you know how to fix my server which is returning a wrong domain in $_SERVER["SERVER_NAME"]?

I don't know. You just have to look around in the server with the root privilege. Most likely it's a ... Read More
Posted by Andy
2016-07-01

Hi Tom,

Even I changed both of the codes:
<script type="text/javascript" src="http://www.uswebcity.com/polls2/jquery.js"></script>
<script type="text/javascript" ... Read More
Posted by Tom
2016-07-02

The domain name is reported by $_SERVER["SERVER_NAME"] at
web/app.code/CTClassSys.inc.php, line 62.

I believe your server is returning a wrong domain in $_SERVER["SERVER_NAME"]. If you don't want ... Read More
Posted by Andy
2016-06-29

Hi Tom,

Thank you so much for the speedy reply. My hosting company said they could not changed my default domain name to www.uswebcity.com. So can you tell me how to change the poll scripts (PHP) to ... Read More
Posted by Tom
2016-07-01

OK, this may solve the problem. In the step1, use this line
<script type="text/javascript" src="http://www.uswebcity.com/polls2/ajax-poll.php"></script>
instead of
... Read More
Posted by Andy
2016-06-28

I don't see the polls (all three poll-simple, poll-background-image, and poll-multi-choice) show up on the pages. Can you check it out? Thanks.
Posted by Tom
2016-06-29

Hi Andy,

just remove "www." from "www.uswebcity.com" like
http://uswebcity.com/polls2/poll-simple/index.php

It looks like "uswebcity.com" is the default domain name in your website ( instead of ... Read More
Posted by Andy
2016-06-28

Hi Tom,

I installed the poll on my website. But it isn't working. The PHP version is PHP 5.6. Here is the URL: http://www.uswebcity.com/polls2/poll-simple/index.php Thanks.
Posted by Mark
2016-06-16

Thanks tom, im still learning PHP and AJAX ill let you know how it goes, thanks :)
Posted by Tom
2016-06-17

You are welcome :)
Posted by haritha mullapudi
2016-05-31

Good efforts helps a lot
Posted by Tom
2016-05-31

You are welcome!
Posted by Jake
2016-05-31

Really nice... my only gripe is the tclass in <div class='ajax-poll' tclass='poll-simple'></div>
breaks W3C validation. :(
Posted by Tom
2016-05-31

Hi,

>Really nice... my only gripe is the tclass in <div class='ajax-poll' tclass='poll-simple'></div>
breaks W3C validation

You are right. The first version of Ajax Poll Script was written long ... Read More
Posted by Carlos Rivas
2016-05-30

I need the script but voting with image for each vote the user must choose two images and add it to individual statistics live ... I have ???
Posted by Tom
2016-05-31

Hi,

>I need the script but voting with image for each vote the user must choose two images and add it to individual statistics live

You can modify Ajax Script to fit it to your needs but probably ... Read More
Posted by Jim
2016-05-02

Tom, all is good. Thank you. Great work!
Posted by Tom
2016-05-03

You are welcome!
Posted by Jim
2016-05-01

At the end of the installation guide page, it says "Now, it's time to edit the poll templates & settings to make it truly original. To edit them, read the previous section, "Editing poll templates & ... Read More
Posted by Tom
2016-05-02

Hi Jim,

>To edit them, read the previous section, "Editing poll templates & settings". Where is this page?

It's not really a page. It refers to the previous step, "Step 5 : Editing poll templates & ... Read More
Posted by vishu
2016-04-13

I want to know can we put multiple poll on different pages with different results
Posted by Tom
2016-04-14

Hi,

>can we put multiple poll on different pages with different results

Yes, you can if you mean each of the multiple polls has it's own poll folder ( which contains tpl.front.inc.php, ... Read More
Posted by Harry S
2016-04-06

I would like to know if you have the option to vote with pictures ?
Posted by Tom
2016-04-07

Hi,

>I would like to know if you have the option to vote with pictures ?

Yes if you don't mind modifying poll templates yourself. You can put <img> tags in poll templates.
Posted by Kris
2016-03-28

Hello, is there any way to put two polls in the same page with different styles? thanks in advance!
Posted by Tom
2016-03-29

Hi, If you mean two instances of the same poll, you'll use the same css in them. But you can always copy a poll folder and give it a new name. As long as the poll is in a separate folder, you can ... Read More
Posted by Roman
2016-03-18

This is the best poll script! Many thanks for it.
Is there any way to set result view by default for those users, who has already voted ?
Posted by Tom
2016-03-20

Hi, it hasn't been implemneted yet. It was suggested by several users and I think it's an interesting option. Thank you for your suggestion!
Posted by Richard
2016-02-03

is there a way to remove the vote button and move the submit function to the choice clicked on, as in make the radio into buttons, once you click on the options, it will count it as a vote.

I figure ... Read More
Posted by Tom
2016-02-05

Currently there isn't a simple solution for that. You just have to modify the code. I think the idea is very important. I really want to implement it in the next version. Thank you for your ... Read More
Posted by Unna
2016-01-22

Your code looks so good.I need this function only,but in java.If there is any source or links you know..Please refer.Thanks in advance.
Posted by Tom
2016-01-22

>If there is any source or links you know

Sorry, I don't know.
Posted by adam
2016-01-20

http://coko.foundation/blog.html#vote_for_pubsweet_logo

thanks...great script.

adam
Posted by Tom
2016-01-20

Wow, looks nice!
Posted by christian
2016-01-19

Tom,
First off; many thanks!!!! This script really helped me further my knowledge of php. (which was extremely minimal/sad...now just kinda sad) :)

So here's my question(s): I want to add a ... Read More
Posted by Tom
2016-01-20

Hi,

>I want to add a description underneath each item in the poll.

Find lines like this in class.inc.php
... Read More
Posted by adam
2016-01-18

Im so happy people still write good scripts which dont need a database and are simple to run and adapt. Many many thanks. Awesome work and a great script.

Especially thanks for making it free ... Read More
Posted by Tom
2016-01-20

I'm glad to hear that!
Posted by Leandro
2016-01-09

Hello Tom, thanks for your fast reply, the center tipbox worked perfectly.
Now I'm having another problem, I load the poll inside home.html, and home.html inside "section" container of index.html. ... Read More
Posted by Tom
2016-01-09

Sorry, it doesn't have the feature to initialize polls after the page load. I think it's an important feature and I should add it in the next version. Thank you for reminding me!
Posted by Leandro
2016-01-04

Hello, first of all thanks for this great utility! is really awsome... I got only one question, how can I center the tipbox position inside div container? I look into tclass.js.inc.php and I found ... Read More
Posted by Tom
2016-01-04

> I found the css style parameters,

Yes, you found the right file and pinpointed the right location!
To center the tipbox, replace the following lines,
... Read More
Posted by Valentin
2015-12-26

which file i need to include to can use reset function?
Posted by Tom
2015-12-27

>which file i need to include to can use reset function?

There is no single PHP function to rest both IPs and cookies. For IPs, the clear() method in web/app.ajax-poll/include/CIPBlock.inc.php does ... Read More
Posted by Chandra
2015-11-29

Hi tom

is there a way just to show gratitude after users vote ... user can not see the results of the vote ... only administrators who know the link can view the results of the vote. thank you for ... Read More
Posted by Tom
2015-11-29

>is there a way just to show gratitude after users vote ... user can not see the results of the vote

How about removing the result from the result template (web/poll-(poll name)/tpl.result.inc.php)? ... Read More
Posted by prem anand
2015-10-31

while i am trying to open web/simple-poll/index.php it not show the poll preview.. it shows some code to put this folder in ajax script folder...
how will i do this please make me understand
Posted by Tom
2015-11-04

>not show the poll preview
Most likely, some errors were generated. But you couldn't see it becuase your website is configured not to show error messages. The first thing you need to do is see the ... Read More
Posted by Manoel Santos
2015-10-22

Ok, Tom.
Many thanks for the reply.
I followed all the installation manual and I am getting the following error in time to publish in a HTML module Joomla:

file (class.inc.php) does not exist ... Read More
Posted by Tom
2015-10-27

Hi, first please make sure you see a poll in the preview page. Once you see it, all you need to do is to copy the code displayed in the preview page to your own page.
Posted by Manoel Santos
2015-10-22

Hi friend!

I was looking for a research module to put on my website, whose platform is Joomla, version 3.4.5. Looking, I got your script. I do not have much knowledge of programming, but from what I ... Read More
Posted by Tom
2015-10-22

> How do I translate the frontpage for the Portuguese-Brazil?

You can edit the poll templates, which are located at
web/poll-(--poll-name--)/tpl.front.inc.php
... Read More
Posted by Rick
2015-10-10

Is there a way to make a reset feature for IP address after 24 hours? without manually doing it or having that visible button reset?

Thanks!
Posted by Tom
2015-10-18

>Is there a way to make a reset feature for IP address after 24 hours

Sorry, there is no built in feature like that.
Posted by Rick
2015-10-08

I can't seem to get it to allow more than one vote on the PC,I tried with Chrome and Explorer. I'd kinda like a voter to be able to vote once a day. It does work on my cell phone though, not sure ... Read More
Posted by Tom
2015-10-09

Hi, cookie-block-period is for cookie only. It doesn't work for IP address.
Posted by Martin
2015-10-08

If anybody else is having the error that the result bars are not animated in some browsers - in my case using a current jquery.js fixed the issue.
Posted by Rick
2015-10-08

Tom, If the same person votes again from the same ip address within the 24 hour period will it reset? or will it have no effect?
Posted by Tom
2015-10-09

>If the same person votes again from the same ip address within the 24 hour period will it reset?

No, it won't. There is no reset feature for IP address.
Posted by Rick
2015-10-06

Can this be changed so a user can vote once per day by using this in the defined area?
(e.g.) 60*60*24 => One Day
$poll->attr( "cookie-block-period", 60*60*24 );


Thanks so much!


Posted by Tom
2015-10-07

>Can this be changed so a user can vote once per day by using this in the defined area?

Yes.
Posted by Rick
2015-10-06

Figured it out, it was on my end...not your script :)
Posted by Tom
2015-10-06

OK!
Posted by Rick
2015-10-06

The "You have all ready voted" dont work for me. I'm using Chrome and I also tried it on Explorer.

Thanks much! Great scripts!
Posted by Martin
2015-10-05

A working link might be even better... :-(
http://www.owlsnest.eu/

Thanks
Martin
Posted by Tom
2015-10-06

Hi, It's most likely some kind of errors are happening on javascripts other than the poll script. Check the javascript console of the browser. You may find some clues about it.
Posted by Martin
2015-10-04

Hi Tom,

A link to my side would maybe helpful...
http://www.olsnest.eu/

Thanks
Martin
Posted by Martin
2015-10-04

Hi Tom,

I noticed that the results displayed in Chrome have a nice animation where the bar is growing from left to right. In Firefox and IE there is not such an effect on my page. Bute the demos ... Read More
Posted by DCV
2015-08-06

Thanks Tom, all good. It was a rights issue (644 not 646) on the files in the web folder.
Posted by Tom
2015-08-11

Great!
Posted by DCV
2015-08-01

Hello,

Need some guidance...

I have installed the web folder on my current web server in on of my existing websites and run, but I get a blank screen each time. If I run poll-simple I get the ... Read More
Posted by Tom
2015-08-05

Some kind of errors are happening there. The first thing you want to check is the error log of your web site. Usually, you can view the error log in your web site's control panel such as cPanel, ... Read More
Posted by vidit
2015-07-26

is it possible to fit multiple poll background image in single image.
plz tell me sir hoe?
Posted by Tom
2015-07-29

Hi, I'm not sure what you meant by "multiple poll background image."
The backgrond is usually only one, isn't that right? Anyway, did you take a look at poll templates? Feel free to modify it. Add ... Read More
Posted by Mark
2015-07-21

Please how and where can i remove the
1) Installation steps
2) Ajax Poll Script on the left upper corner of the page
3) APSMX-302
Ajax Poll Script v3.02poll-background-image
e.t.c..
WHAT I MEAN IS ... Read More
Posted by Tom
2015-07-24

Hi,

>I WANT TO HAVE ONLY THE VOTING ON THE PAGE

The easiest method is just create an blank html page in the folder and put the poll on it. Now you got a page that has nothing but the poll. If you ... Read More
Posted by Pippo
2015-07-21

very beautiful scripts!
my server says I have write permissions , but your file is locked . I'll find the solution !
Posted by Tom
2015-07-24

>your file is locked

Sometimes, it happens because (1) FTP connection is stuck or (2) you opened the data file in a text editor that grabs exclusive read/write lock.
Posted by Nick
2015-07-20

Hi,
Thank you for the great script! Could you please tell me how to add an extra field (textarea) to the form? I added into the file tpl.front.inc.php my field (textarea), but after this this field ... Read More
Posted by Tom
2015-07-20

Hi, any parameters are passed by Ajax calls, so you need to modify the Ajax call if you want to pass extra parameters. The ajax calls are made in the javascript file, web/app.code/tclass.js.inc.php.
Posted by FearLess Hunter
2015-06-28

Hi,

Thanx for the script ! :) I would like to use it on my website. I would like to know how to create a different poll for multiple web pages? I tried but couldn't find the solution.

Please reply ... Read More
Posted by Tom
2015-06-29

You can create as many polls as you want. To create a new poll, please read the step 6 of this page
http://www.phpkobo.com/install-APSMX-302
Posted by John
2015-06-05

First want to say great poll, you are providing an awesome service! I have the error message coming up under the radio button and text after I tried to integrate it into an existing page. How can you ... Read More
Posted by Tom
2015-06-09

Hi, I think the cause is z-index. You can edit either the host page's z-index or the tipbox's. To edit the tipbox's index, open web/app.code/tclass.js.inc.php and find and edit the following code.
... Read More
Posted by NICO
2015-04-22

Can you help me? when I open web/poll-simple/index.php or web/poll-background-image/index.php or web/poll-multi-choice/index.php in chrome browser ,, the whole code of that index.php appear, instead ... Read More
Posted by Tom
2015-04-30

Obviously, PHP pages are not executed in your web site. Many things can cause this. The first thing I suspect is that PHP is not installed in your web site.
Posted by Stephen
2015-04-09

This is an excellent script. Thanks for offering it. I would like to track users but can't figure out where you are writing the vote data to the DB. Can you tell me where this is happening in the ... Read More
Posted by Tom
2015-04-30

Hi,

>I would like to track users but can't figure out where you are writing the vote data to the DB.

The script doesn't wirte to a database. It saves everyhting in text files. You can find the text ... Read More