如何使用PHP记录访问者? [英] How to log visitors using PHP?
本文介绍了如何使用PHP记录访问者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以给我一个示例脚本,将所有访问者记录到我的网站
网站吗?
我正在寻找一个简单的脚本这将捕获IP地址,主机名,
浏览器,操作系统和引用页面 - 并将该信息写入MySql。
我创建了一个MySql数据库 - 访问者 - 上面提到的列,但是
正在摸索试图开始使用PHP ...任何帮助都表示赞赏!
解决方案
好的,这是我到目前为止所得到的:
<?php
//访问者ip address
ipaddress =
REMOTE_ADDR;
//获取访问日期
Can someone point me to a sample script that will log all visitors to my web
site?
I''m looking for a simple script that will capture IP address, Host Name,
Browser, OS, and referring page - and write that info to MySql.
I''ve created a MySql database - visitors - with the columns mentioned above, but
am fumbling trying to get started with PHP... any help is appreciated!
解决方案
okay, here''s what I''ve got so far:
<?php
//get visitors ip address
ipaddress =
REMOTE_ADDR;
//get visit date
这篇关于如何使用PHP记录访问者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文