分类:
2009-02-05 16:16:16
function get_ip()
{
if(getenv("HTTP_CLIENT_IP") && getenv("HTTP_CLIENT_IP")!="unknown")
$ip = getenv("HTTP_CLIENT_IP");
elseif(getenv("HTTP_X_FORWARDED_FOR") && getenv("HTTP_X_FORWARDED_FOR")!="unknown")
$ip = getenv("HTTP_X_FORWARDED_FOR");
elseif(getenv("REMOTE_ADDR") && getenv("REMOTE_ADDR")!="unknown")
$ip = getenv("REMOTE_ADDR");
else
$ip = "none";
return $ip;
}