php禁止代理访问的方法:首先打开相应的脚本文件;然后通过“if($_SERVER['HTTP_PROXY_CONNECTION'] || $_SERVER['HTTP_VIA']…){…}”方法实现禁止代理访问即可。
推荐:《PHP视频教程》
PHP禁止代理访问
if($_SERVER['HTTP_PROXY_CONNECTION'] || $_SERVER['HTTP_VIA'] || $_SERVER['HTTP_USER_AGENT_VIA'] || $_SERVER['HTTP_X_FORWARDED_FOR'] || $_SERVER['HTTP_PROXY_CONNECTION'] || $_SERVER['HTTP_CACHE_CONTROL'] || $_SERVER['HTTP_CACHE_INFO']) { die("请勿使用代理服务器访问, 谢谢"); }
or
PHP禁止代理访问
<?php if(empty($_SERVER['HTTP_VIA']) and empty($_SERVER['HTTP_X_FORWARDED_FOR']) and empty($_SERVER['HTTP_XROXY_CONNECTION']) and empty($_SERVER['HTTP_PRAGMA']) ){ // 没有使用代理 }else{ exit('<meta charset="utf-8" />禁止使用代理访问'); }
更多关于云服务器,域名注册,虚拟主机的问题,请访问西部数码官网:www.west.cn