作者:潇洒树春不_970 | 来源:互联网 | 2018-07-17 04:06
php判断用户浏览器类型与来自页面
function chkre(){
global $_SERVER, $r_main;
if(isset($_SERVER['HTTP_REFERER'])){
$u=parse_url($_SERVER['HTTP_REFERER']);
if($u['host']!=$_SERVER['HTTP_HOST'])return false;
}
return true;
}
function chkuag($a='MSIE'){
global $_SERVER;
if(isset($_SERVER['HTTP_USER_AGENT'])){
$age=strtoupper($_SERVER['HTTP_USER_AGENT']);
if(strstr($age, $a))return true;
}
return false;
}