php获取访问的ip
时间:2011-05-17 来源:JaiHo
function getip(){ if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){ $online_ip = $_SERVER['HTTP_X_FORWARDED_FOR']; }elseif(isset($_SERVER['HTTP_CLIENT_IP'])){ $online_ip = $_SERVER['HTTP_CLIENT_IP']; }else{ $online_ip = $_SERVER['REMOTE_ADDR']; } return $online_ip; }
相关阅读 更多 +