Home > Backend Development > PHP Tutorial > php获取访问客户端的一些信息

php获取访问客户端的一些信息

WBOY
Release: 2016-06-23 14:21:12
Original
1056 people have browsed it

php获取客户端访问的信息, php获取信息  php php基础

我要获取访问我网站客户端的外网ip,主机名,访问时间,用什么浏览器访问。不知道该怎么写,找了一些方法,部分可以用部分用不了。希望大侠帮帮忙。
print_r($_SERVER['REMOTE_HOST']);//这种办法获取主机名好像不行
print_r($_SERVER['REMOTE_ADDR']);//获取外网ip可以

回复讨论(解决方案)

客户端不一定有主机名的,而且应该要开放客户端 ident端口(port:113)才能获得

var_dump($_SERVER);

其??取??意?也不大,因??些?西都能模?仿造.

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template