Function can get client ip address using this function :)
//-----------------------------------------------
function getIP() {
$ip;
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 = "UNKNOWN";
return $ip;
}
//-----------------------------------------------
Usage:
<
$client_ip=getIP();
echo "Your IP :".$client_ip;
?>
//--------------------------------------------
Thursday, August 9, 2007
Subscribe to:
Post Comments (Atom)
4 comments:
Thanks very useful website.. im expecting more..!
Thanks! This was exactly what I needed! Well done.
i try this scrip on my server. it not work in web proxy
this web proxy
http://www.japanweb.info/
Can i block IP client come from web proxy ?
i can't block IP from every web proxy.
sorry for my bad English.
the below code will work well and fine..
$ip= $REMOTE_ADDR;
echo "
Your ip : " .GetHostByName($ip);
thank u...
Post a Comment