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"))?

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


Nick Wilson wrote:

>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
>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
>Version: GnuPG v1.0.6 (GNU/Linux)

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

Reply via email to