home - php help - faq - download
what do I need to use Littlepoll?
A PHP enabled server, and (FTP) access to it. And a text editor. I like SmartFTP as a FTP client. It is free for personal use and works fine. As a text editor, I would recommend textpad or, if you're looking for the Lada Niva of text editors, check out VIM
the test setup doesn't show up at all
Check out the page source code (in IE, it's view - source). Can you spot some unprocessed php tags there, like <?php ?> This means the php isn't being processed. Probably your server isn't php enabled. Try downloading some other scripts and see if they work.
the test setup gives errors
If the test thing gives errors - and you're sure you didn't touch ANY of the code -most of the time, the read/write permissions aren't set on the lp_dat.dat file. On a Windows pc, it's done under 'right mouse - sharing...'. On UNIX, you have to set the attributes with CMOD. If you use FTP to get to your server, your FTP program should have a function for setting this.
When you're sure this is set ok, it might be that not all the files are in the same directory. They should be. If this is also set fine, sent me a mail.
the test works, but it doesn't work on my page
Be sure to use the 'recookie' function of the test facility before you start testing your own page. When the test site and your site are located on the same server, they will share the same cookie. So once you voted in the test site, you can't vote anymore in your own site.
Sometimes - I don't know the exact reason - a 'headers already sent' error pops up. You can solve this by making sure the first <?php tag is the first thing in the file. No spaces, no line breaks in front of it (just like in the test file).
i want to see the results without voting
The idea behind littlepoll was that you should encourage your users to vote. So if they want to see the results, they first need to vote. However, if this idea doesn't work for your site, I created a little enhancement for showing results. Code can be downloaded here: download lpresults
i want to show the number of votes instead of a percentage
That's possible, but you need to change the source code a little bit. Don't worry: it's really easy. Open up lp_source.php in a text editor, and find this piece of code (I use textwrangler as an editor on the Mac):
Change it to (only the highlighted line is changed):
If you'd like to show both a percentage and the number of votes, in this fashion:
Then change the code to (only the highlighted part is changed):
it still doesn't work
Send me a mail. Please be as specific as possible, which step of the process fails, what error do you get, etc. I am glad to help out, but my clairvoyance is limited.
please donate!
Even though it is a simple script, it took me quite some time to really make it perfect. Also, writing this page and FAQ, it takes quite some time and effort, you know.
If you enjoy the script, and especially is you are using the script for commercial purposes, please donate some money. Think about the time I saved you, and what that is worth to you. Any amount is greatly appreciated, and it will definitely make you feel better! Thanks!
Suggested amount, non-commercial use: $2, commercial use: $5.