我的番茄炒蛋
生活如此精彩,挑战无处不在!

导航

 
php getip
function getip(){    //获取真实ip             if ($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]){                 return  $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"];             }elseif($HTTP_SERVER_VARS["HTTP_CLIENT_IP"]){                 return  $HTTP_SERVER_VARS["HTTP_CLIENT_IP"];             }elseif($HTTP_SERVER_VARS["REMOTE_ADDR"]){                 return  $HTTP_SERVER_VARS["REMOTE_ADDR"];             }elseif(getenv("HTTP_X_FORWARDED_FOR")){                 return  getenv("HTTP_X_FORWARDED_FOR");             }elseif(getenv("HTTP_CLIENT_IP")){                 return getenv("HTTP_CLIENT_IP");             }elseif(getenv("REMOTE_ADDR")){                 return  getenv("REMOTE_ADDR");             }else{                 return "Unknown";             }     }
posted on 2007-11-29 08:22  bluesky  阅读(404)  评论(0编辑  收藏  举报