Following from my last post, here is the method to get your IP address if you are behind a proxy.
-
function getRealIPAddr() {
-
{
-
$ip=$_SERVER[‘HTTP_CLIENT_IP’];
-
}
-
{
-
$ip=$_SERVER[‘HTTP_X_FORWARDED_FOR’];
-
}
-
else
-
{
-
$ip=$_SERVER[‘REMOTE_ADDR’];
-
}
-
return $ip;
-
}
As this method gets more accurate results it is better to use this than the previous function.