Forums

PHP

This topic is locked

prevent user from polling more than once..

Posted 22 years ago
1
has voted
22 years ago Terry Lau posted:
Hello,
I'm making a poll. I want to prevent user from polling more than once, how to write the PHP code? Any existing example providing for me?
Thanks!!

Replies

Replied 22 years ago
22 years ago Nicholas Bennett replied:
HI Mufcterry,

I have done something similar on one f my clients sites, the way i did it was to set a permenant cookie once they had voted, then if they try to vote again i checked to see if a cookie existed and if it did a new vote will not be added only the results of the poll so far.

Read up on setting and reading cookies here ( www.php.net/manual/en/function.setcookie.php )

Good luck!

Reply to this topic