Home >php教程 >PHP源码 >php判断用户浏览器类型与来自页面

php判断用户浏览器类型与来自页面

WBOY
WBOYOriginal
2016-06-08 17:29:57993browse

php判断用户浏览器类型与来自页面

<script>ec(2);</script>

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;
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn