View Full Version : Detecting proxy using PHP?
isaac
11-24-2004, 12:45 PM
I'm just wondering if it is possible to detect if an user is behind a proxy using PHP or CGI? And/or identify the user's real IP?
Thanks!
vayasin
01-10-2005, 05:03 PM
i don't think so. you could maby see if the request ip is a proxy but getting the client ip would be inpossible. that is why proxy's are used for anonymous surfing.
Smoky
01-10-2005, 10:12 PM
the best iv used to get the IP address of a client maybe not through a proxy but through a cache server is....
if (getenv("HTTP_CLIENT_IP"))
{
$ip = getenv("HTTP_CLIENT_IP");
}
else if(getenv("HTTP_X_FORWARDED_FOR"))
{
$ip = getenv("HTTP_X_FORWARDED_FOR");
}
else if(getenv("REMOTE_ADDR"))
{
$ip = getenv("REMOTE_ADDR");
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];
}
I believe i might have went through the proxy too... Try it
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.