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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.