PHP禁止代理访问


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" />禁止使用代理访问');
}

发表回复