Jump to content

Help With Polls


Unholy Prayer

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/ 
Link to comment
https://forums.phpfreaks.com/topic/16434-help-with-polls/
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]
 
Link to comment
https://forums.phpfreaks.com/topic/16434-help-with-polls/#findComment-68437
Share on other sites

Archived

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

×
×
  • Create New...

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.