What then happens with users who are behind a firewall/proxy (probably 
have non-routable IP addresses on theire LAN) and share one internet 
connection. They all have the same remote IP address (routable IP 
address of the firewall).
This would mean that only one user of that group can vote.

I'm not sure if the solution below also works for non-routable 
IP-addresses behind a firewall. It works for proxies.

function clientIP()
{
  return (getenv("HTTP_X_FORWARDED_FOR"))?
    getenv("HTTP_X_FORWARDED_FOR"):getenv("REMOTE_ADDR");
}


Other solution might be
- use cookies to store the vote on the client
- use login name / password to check votes



René


Nick Wilson wrote:

>-----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-----
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to