'page'=>$url,
'browser'=>$browser,
'create_time'=>$time
];
Visitor::create($data);
return $next($request);
}
private function getCountryByIp($ip)
{
$ipInfo = file_get_contents("https://ipinfo.io/{$ip}");
$ipInfoArray = json_decode($ipInfo, true);
$userCountry = '未知';
if (isset($ipInfoArray['country'])) {
$userCountry = $ipInfoArray['country'] . '-' . $ipInfoArray['region'] . '-' . $ipInfoArray['city'];
}
return $userCountry;
}
private function getBrowser($userAgent)
USER | www |
HOME | /home/www |
HTTP_USER_AGENT | claudebot |
HTTP_ACCEPT | */* |
HTTP_HOST | www.togtok.com |
PATH_INFO | |
REDIRECT_STATUS | 200 |
SERVER_NAME | www.togtok.com |
SERVER_PORT | 443 |
SERVER_ADDR | 172.31.25.41 |
REMOTE_PORT | 56776 |
REMOTE_ADDR | 54.160.243.44 |
SERVER_SOFTWARE | nginx/1.20.2 |
GATEWAY_INTERFACE | CGI/1.1 |
HTTPS | on |
REQUEST_SCHEME | https |
SERVER_PROTOCOL | HTTP/2.0 |
DOCUMENT_ROOT | /www/wwwroot/www.togtok.com/public |
DOCUMENT_URI | /index.php |
REQUEST_URI | /1470-qy60083-printhead-printer-for-canon-mg6310-mg6320-mg6350-mg6380-mg7120-mg7150-mg7180-ip8720-ip8750-ip8780-mg7140-mg7550-mg7740.html |
SCRIPT_NAME | /index.php |
CONTENT_LENGTH | |
CONTENT_TYPE | |
REQUEST_METHOD | GET |
QUERY_STRING | s=/1470-qy60083-printhead-printer-for-canon-mg6310-mg6320-mg6350-mg6380-mg7120-mg7150-mg7180-ip8720-ip8750-ip8780-mg7140-mg7550-mg7740.html |
SCRIPT_FILENAME | /www/wwwroot/www.togtok.com/public/index.php |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1711664093.703 |
REQUEST_TIME | 1711664093 |