Home > php教程 > PHP源码 > body text

虾囧cms笑话程序

PHP中文网
Release: 2016-05-20 12:58:13
Original
2284 people have browsed it


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;
}
Copy after login

                   

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!