PHP编程:巧妙获得网站访客的真实IP

而以下程序就可以获得真实IP:

if (!empty($_SERVER[‘HTTP_CLIENT_IP’]))

$ip=$_SERVER[‘HTTP_CLIENT_IP’];

else if (!empty($_SERVER[‘HTTP_X_FORWARDED_FOR’]))

$ip=$_SERVER[‘HTTP_X_FORWARDED_FOR’];

else

$ip=$_SERVER[‘REMOTE_ADDR’];

 » 本站地址:http://www.gomoth.com

标签: