終於寫出有用的東西了!
能夠偵測大部分透過代理伺服器存取的ip.
//beiji.com 2000.6.17
$ip = getenv("REMOTE_ADDR"); getenv("HTTP_VIA");
$f = getenv("HTTP_X_FORWARDED_FOR");
$c = getenv("HTTP_XROXY_CONNECTION"); '
REMOTE_ADDR';
print $ip;
if (($v=="")&&($f=="")&&($c=="")&&($o= ="")){
print "
not through proxy";
}
else {
print "
through proxy"; ';print $v;
print '
http_x_forwarded_for: ';print $f;
print '
http_xroxy_connection: ';print $c;
print '
http_prag: ';print $c;
print '
http_prag: '
http_prag: '
http_prag: '
http_prag: '
http_prag: '
http_prag: '
http_prag: '
http_prag: '
http. print $o;
}
?>
以上就介紹了proxyserver 用php來偵測proxy,包含了proxyserver的內容,希望對PHP教學有興趣的朋友有幫助。