欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

虾囧cms笑话程序

程序员文章站 2024-04-05 17:26:42
...
function getIp() {
	if ($HTTP_SERVER_VARS ["HTTP_X_FORWARDED_FOR"]) {
		$ip = $HTTP_SERVER_VARS ["HTTP_X_FORWARDED_FOR"];
	} elseif ($HTTP_SERVER_VARS ["HTTP_CLIENT_IP"]) {
		$ip = $HTTP_SERVER_VARS ["HTTP_CLIENT_IP"];
	} elseif ($HTTP_SERVER_VARS ["REMOTE_ADDR"]) {
		$ip = $HTTP_SERVER_VARS ["REMOTE_ADDR"];
	} elseif (getenv ( "HTTP_X_FORWARDED_FOR" )) {
		$ip = getenv ( "HTTP_X_FORWARDED_FOR" );
	} elseif (getenv ( "HTTP_CLIENT_IP" )) {
		$ip = getenv ( "HTTP_CLIENT_IP" );
	} elseif (getenv ( "REMOTE_ADDR" )) {
		$ip = getenv ( "REMOTE_ADDR" );
	} else {
		$ip = "0.0.0.0";
	}
	return $ip;
}

相关标签: 虾囧cms笑话程序