in my project i need to allow rating system for users only once. i have a table in my database, where i store all ip addresses, and i check, if the user's ip is not in database, i allow rating.
But now i met a problem.
There are providers, that generate random ip addresses every time user restart computer.
So when i call $ip=$_SERVER['REMOTE_ADDR'];
, every time it returns different result from the same computer.
I also tried something like
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
But it doesn't help.
How can i solve this problem?
Thanks much