Stopping multiple votes by IP
| From: | Nick Wilson | Date: | Wed, 05 Jun 2002 10:32:43 +0000 |
| Subject: | Stopping multiple votes by IP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-100673@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi everyone.
I need to ensure that only one 'vote' per 'article' can be cast by each
visitor and was hoping you might share any opinions you have on my
solution:
IP's seem the way to go so I thought the simplest and most secure method
would be this:
Have a MySQL table with 2 fields: IP and ARTICLE_ID
Check the $REMOTE_ADDR against this table WHERE IP = $REMOTE_ADDR AND
$articl_id = $ARTICLE_ID
IF there is no match, record the vote and insert their IP and the
article id
IF /is/ a match, decline.
Anyone see any inherent problems with that?
Many thanks!
- --
Nick Wilson // www.explodingnet.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
iD8DBQE8/ejLHpvrrTa6L5oRAjf5AJ98ew6rICv4DUAqACXXu1Ru7TxYBQCfbKxn
yzTmfMgihXvX65sY/bCMMDA=
=zRNV
-----END PGP SIGNATURE-----