PHP如何高效获取游客访问细节信息?
- 内容介绍
- 文章标签
- 相关推荐
本文共计358个文字,预计阅读时间需要2分钟。
当游客访问贵网站时,此类功能可以将游客的相关信息存储在数据库中。它还能检索游客的IP地址和请求头,了解当前页面的访问者细节。目前,它记录了用户的操作系统、浏览器等信息。
它还可以检索从它的IP地址和其它请求头的到当前页面访问者若干细节。
目前,它记录用户计算机操作系统,浏览器,IP地址,国家,城市,地理坐标,互联网服务供应商或使用ip-api.comWeb服务。
所存储的数据可以关联到一个给定的域名地址。
详细下载地址:www.codepearl.com/files/239.html
1.[图片] 30111106_nDSh.jpg
2.[代码][PHP]代码
<?php www.codepearl.com include('Visitors.php'); $info=new Visitors(); $info->setSubdomain("www.codepearl.com"); $info->getVisitorInfo($_SERVER['HTTP_USER_AGENT']); $info->insertInfo(); ?> <!DOCTYPE html> <html lang="en" xmlns="www.w3.org/1999/html"> <head> <meta charset="utf-8"> <meta ip-api.com/php/'.$this->getUserIp())); //获取IP接口自己可以设定 $this->setUserCountry($query['country']); $this->setUserCountryCode($query['countryCode']); $this->setUserCity($query['city']); $this->setUserStateOfRegion($query['regionName']); $this->setLatitude($query['lat']); $this->setLongitude($query['lon']); $this->setISP($query['isp']); $this->setORG($query['org']); $this->setAS($query['as']); $this->setTimeZone($query['timezone']); }
5.[图片] 30111106_nDSh.jpg
本文共计358个文字,预计阅读时间需要2分钟。
当游客访问贵网站时,此类功能可以将游客的相关信息存储在数据库中。它还能检索游客的IP地址和请求头,了解当前页面的访问者细节。目前,它记录了用户的操作系统、浏览器等信息。
它还可以检索从它的IP地址和其它请求头的到当前页面访问者若干细节。
目前,它记录用户计算机操作系统,浏览器,IP地址,国家,城市,地理坐标,互联网服务供应商或使用ip-api.comWeb服务。
所存储的数据可以关联到一个给定的域名地址。
详细下载地址:www.codepearl.com/files/239.html
1.[图片] 30111106_nDSh.jpg
2.[代码][PHP]代码
<?php www.codepearl.com include('Visitors.php'); $info=new Visitors(); $info->setSubdomain("www.codepearl.com"); $info->getVisitorInfo($_SERVER['HTTP_USER_AGENT']); $info->insertInfo(); ?> <!DOCTYPE html> <html lang="en" xmlns="www.w3.org/1999/html"> <head> <meta charset="utf-8"> <meta ip-api.com/php/'.$this->getUserIp())); //获取IP接口自己可以设定 $this->setUserCountry($query['country']); $this->setUserCountryCode($query['countryCode']); $this->setUserCity($query['city']); $this->setUserStateOfRegion($query['regionName']); $this->setLatitude($query['lat']); $this->setLongitude($query['lon']); $this->setISP($query['isp']); $this->setORG($query['org']); $this->setAS($query['as']); $this->setTimeZone($query['timezone']); }

