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"; } }