Unholy Prayer Posted August 3, 2006 Share Posted August 3, 2006 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/ Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 3, 2006 Share Posted August 3, 2006 the code snippit checking if they have voted needs to be on that page before the mysql query Quote Link to comment Share on other sites More sharing options...
tomfmason Posted August 3, 2006 Share Posted August 3, 2006 You could add some kind of session variable. After they vote then you can do something like this[code=php:0]<?phpsession_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]<?phpsession_start();if ($_SESSION['posted'] == "true") { echo "You may not vote twice"; include("something.php"); exit;}?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.