Home  >  Article  >  php教程  >  虾囧cms笑话程序

虾囧cms笑话程序

PHP中文网
PHP中文网Original
2016-05-20 12:58:132292browse


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

                   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn