美博园上网ip检测实用代码之二更详细

以前有朋友留言要美博园的上网ip检测代码,美博园有几种ip检测方式,前文公布了一种基本的检测ip方式 美博园上网ip检测实用代码之一 ,本文是美博园首页下方 美博园ip检测ipcheck 的代理ip查看代码,代理查看更详细,这些ip检测代码公布于此,供自己建立网页的朋友检测ip之用,代码如下:

<?php if ($_SERVER["HTTP_X_FORWARDED_FOR"] != "") {
$IP = $_SERVER["HTTP_X_FORWARDED_FOR"];
$proxy = $_SERVER["REMOTE_ADDR"];
$host = @gethostbyaddr($_SERVER["HTTP_X_FORWARDED_FOR"]);
} else {
$IP = $_SERVER["REMOTE_ADDR"];
$host = @gethostbyaddr($_SERVER["REMOTE_ADDR"]);
} ?>
<?php echo("REMOTE_ADDR :&nbsp;&nbsp;&nbsp;" . $_SERVER['REMOTE_ADDR'] . "\n"); ?><br />
<?php echo("REMOTE_HOST :&nbsp;&nbsp;&nbsp;" . $_SERVER['REMOTE_HOST'] . "\n"); ?><br />
<?php echo("Server Host :&nbsp;&nbsp;&nbsp;" . $host . "\n"); ?><br />
<?php echo("Remote Port :&nbsp;&nbsp;&nbsp;" . $_SERVER["REMOTE_PORT"] . "\n"); ?><br />
<?php echo("Request Method :&nbsp;&nbsp;&nbsp;" . $_SERVER["REQUEST_METHOD"] . "\n"); ?><br />
<?php echo("Server Protocol :&nbsp;&nbsp;&nbsp;" . $_SERVER["SERVER_PROTOCOL"] . "\n"); ?><br />
<?php echo("HTTP_X_FORWARDED_FOR :&nbsp;&nbsp;&nbsp;" . $_SERVER['HTTP_X_FORWARDED_FOR'] . "\n"); ?><br />
<?php echo("HTTP_VIA :&nbsp;&nbsp;&nbsp;" . $_SERVER['HTTP_VIA'] . "\n"); ?><br />
<?php echo("HTTP_CLIENT_IP :&nbsp;&nbsp;&nbsp;" . $_SERVER['HTTP_CLIENT_IP'] . "\n"); ?><br />
<?php echo("HTTP_PROXY_CONNECTION :&nbsp;&nbsp;&nbsp;" . $_SERVER['HTTP_PROXY_CONNECTION'] . "\n"); ?><br />
<?php echo("FORWARDED_FOR :&nbsp;&nbsp;&nbsp;" . $_SERVER['FORWARDED_FOR'] . "\n"); ?><br />
<?php echo("X_FORWARDED_FOR :&nbsp;&nbsp;&nbsp;" . $_SERVER['X_FORWARDED_FOR'] . "\n"); ?><br />
<?php echo("X_HTTP_FORWARDED_FOR :&nbsp;&nbsp;&nbsp;" . $_SERVER['X_HTTP_FORWARDED_FOR'] . "\n"); ?><br />
<?php echo("HTTP_FORWARDED :&nbsp;&nbsp;&nbsp;" . $_SERVER['HTTP_FORWARDED'] . "\n"); ?><br />
<?php echo("HTTP_REFERER :&nbsp;&nbsp;&nbsp;" . $_SERVER['HTTP_REFERER'] . "\n"); ?><br />
<?php echo("HTTP_USER_AGENT :&nbsp;&nbsp;&nbsp;" . $_SERVER['HTTP_USER_AGENT'] . "\n"); ?><br /></p>

原文链接:http://allinfa.com/allinfa-ip-detection-code-part-two.html
※ 除声明转载,美博园文章均为"原创",软件版权归原作者,转载请以上面超链接注明来源!

这里是你留言评论的地方

10 + 9 =

【您可以使用 Ctrl+Enter 快速回复】

Copyright © 2007 - 2017 , Design by 美博园. 版权所有. 【回到顶部】