PHP源码:检测是否代理IP的代码段
本帖最后由 finder 于 2014-12-29 15:06 编辑有时候做好一个landing page, 但是希望过滤掉代理流量, 可以用下面这段PHP代码来检测, 稍加修改就可以过滤了:<?php
if($_SERVER['HTTP_X_FORWARDED_FOR'] ||$_SERVER['HTTP_VIA'] ||
$_SERVER['HTTP_PROXY_CONNECTION'] ||$_SERVER['HTTP_USER_AGENT_VIA'] ||
$_SERVER['HTTP_CACHE_INFO'] ||$_SERVER['HTTP_XROXY_CONNECTION']){
echo 'Your are using Proxy!';
}else{ echo 'Your are Not using Proxy!'; }
?>Enjoy it and hope it can help you.
PHP的好东西,谢谢分享
页:
[1]