美博園上網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>

原文鏈接:https://allinfa.com/zh-tw/allinfa-ip-detection-code-part-two.html
原文標題:美博園上網ip檢測實用代碼之二更詳細 - 美博園
美博園文章均為「原創 - 首發」,請尊重辛勞撰寫,轉載請以上面完整鏈接註明來源!
軟體著作權歸原作者!個別轉載文,本站會註明為轉載。

這裡是你留言評論的地方


請留言


8 + 8 =
【您可以使用 Ctrl+Enter 快速發送】
Copyright © 2007 - 2022 , Design by 美博園. 著作權所有. 若有著作權問題請留言通知本站管理員. 【回到頂部】