Jump to content

Archived

This topic is now archived and is closed to further replies.

Unholy Prayer

Help With Polls

Recommended Posts

Ok, there are only two things wrong with the poll system I am currently using is that users can vote more than once. 

1. Users can vote more than once.  All they have to do is refresh the page.
2. Everytime I refresh the page, the POST DATA prompt comes up.

How do I fix these problems?  You can see my poll system at my newly launched website:
http://www.mtechdev.com/ 

Share this post


Link to post
Share on other sites
the code snippit checking if they have voted needs to be on that page before the mysql query

Share this post


Link to post
Share on other sites
You could add some kind of session variable. After they vote then you can do something like this

[code=php:0]
<?php
session_start();
//your poll code
//if vote is sucessful
$SESSION['voted'] = "true";
?>[/code]

Now you can place this at the top of your poll form
[code=php:0]
<?php
session_start();
if ($_SESSION['posted'] == "true") {
  echo "You may not vote twice";
   include("something.php");
   exit;
}
?>[/code]
 

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.