用php來檢測proxy
更新時間:2006年10月09日 00:00:00 作者:
終于寫出個有用的東西了!
能夠檢測大部分通過代理服務(wù)器訪問的ip.
<?php
//beiji.com 2000.6.17
$ip = getenv("REMOTE_ADDR");
$v = getenv("HTTP_VIA");
$f = getenv("HTTP_X_FORWARDED_FOR");
$c = getenv("HTTP_XROXY_CONNECTION");
$o = getenv("HTTP_PRAGMA");
print '<br>REMOTE_ADDR';
print $ip;
if (($v=="")&&($f=="")&&($c=="")&&($o=="")){
print "<br>not through proxy";
}
else {
print "<br>through proxy";
print '<br>http_via: ';print $v;
print '<br>http_x_forwarded_for: ';print $f;
print '<br>http_xroxy_connection: ';print $c;
print '<br>http_pragma: ';print $o;
}
?>
能夠檢測大部分通過代理服務(wù)器訪問的ip.
<?php
//beiji.com 2000.6.17
$ip = getenv("REMOTE_ADDR");
$v = getenv("HTTP_VIA");
$f = getenv("HTTP_X_FORWARDED_FOR");
$c = getenv("HTTP_XROXY_CONNECTION");
$o = getenv("HTTP_PRAGMA");
print '<br>REMOTE_ADDR';
print $ip;
if (($v=="")&&($f=="")&&($c=="")&&($o=="")){
print "<br>not through proxy";
}
else {
print "<br>through proxy";
print '<br>http_via: ';print $v;
print '<br>http_x_forwarded_for: ';print $f;
print '<br>http_xroxy_connection: ';print $c;
print '<br>http_pragma: ';print $o;
}
?>
相關(guān)文章
使用PHP和XSL stylesheets轉(zhuǎn)換XML文檔
使用PHP和XSL stylesheets轉(zhuǎn)換XML文檔...2006-10-10PHP默認(rèn)安裝產(chǎn)生系統(tǒng)漏洞
PHP默認(rèn)安裝產(chǎn)生系統(tǒng)漏洞...2006-10-10PHP simplexml_load_file()函數(shù)講解
今天小編就為大家分享一篇關(guān)于PHP simplexml_load_file()函數(shù)講解,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧2019-02-02