PHP: Get IP/Host and Proxy Information

April 12th, 2008 · 3 Comments

Below is a method I use to detect the IP Address and Host Name as well as Proxy Information of a visitors. if ($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"] != ""){      // for proxy      $IP = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"];      $proxy = $HTTP_SERVER_VARS["REMOTE_ADDR"];      $host = @gethostbyaddr($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]); }else{      // for normal user     […]

[Read more →]

Tags: PHP