php ip地址解决方案

WBOY
Release: 2016-06-13 12:11:25
Original
878 people have browsed it

php ip地址

<br />global $ip;<br />if (getenv("HTTP_CLIENT_IP"))<br />	$ip = getenv("HTTP_CLIENT_IP");<br />else if(getenv("HTTP_X_FORWARDED_FOR"))<br />	$ip = getenv("HTTP_X_FORWARDED_FOR");<br />else if(getenv("REMOTE_ADDR"))<br />	$ip = getenv("REMOTE_ADDR");<br />else $ip = "Unknow";<br />	return $ip;<br />}<br /> <br />// 使用方法:<br />$ip = getIP();<br />
Copy after login


为什么在一台服务器能正确的获取到ip
另一个台服务器就获取到192.168.1.111
这是什么原因造成的
------解决思路----------------------
另一台服务器你是想说 局域网的吗?

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template