当前位置:Linux教程 - Php - 用php获得浏览器信息

用php获得浏览器信息

用 PHP 获得浏览器信息
2004-02-24 20


GET /temp.php HTTP/1.1
      Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
      Referer: http://199.199.199.5/index.php
      Accept-Language: zh-cn,zh-tw;q=0.5
      Accept-Encoding: gzip, deflate
      User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
      Host: www.bingdu.org
      Connection: Keep-Alive
      Cookie: PHPSESSID=46bb38ce8d7b870dd704bca7ad6071ca
      $var = getenv("$string");
      $string 就是以下一些值了:
      HTTP_ACCEPT //接收的数据类型。
      HTTP_REFERER //引用地址
      HTTP_USER_AGENT //流览器
      HTTP_ACCEPT_LANGUAGE //流览器语言
      HTTP_HOST //主机地址
      HTTP_CONNECTION //连接状态
      HTTP_COOKIE //COOKIE