I've found a great piece of code in a php coding book and I'm trying to figure out a way to control how many time users can vote.
Since I plan to have a good number of polls, I've got this handy $poll variable. And I've decided to use cookies to only allow visiters to vote once per poll. I've got the Setting of the cookie down, but beyond that I can't get anything to work:
<?PHP
$NumberOfPolls = 15.
if (cookie has not been set before) {
$poll = 1.
}
if (cookie has been set before) {
$poll = whatever number the cookie says++;
if ($poll > $NumberOfPoll ) {
print "I'm sorry, but you have already voted on all of the current Polls. Please come back soon!";
and do NOT do the rest.
}
}
?> End PHP
As far as how to impliment that, it baffles me. Futher on down, when the user clicks the "Submit" button, a cookie is placed with the variable $poll.