|
 |
您现在的位置: 红色黑客联盟 >> 程序开发 >> Web开发 >> php编程 >> 正文 |
| 网站当前的在线人数 |
|
|
|
| 文章录入:7747.Net 责任编辑:7747.Net 更新时间:2008-1-19 15:33:04 |
|
|
【字体:小 大】 |
|
这是我的多用户统计的在线统计部分 gb_temp表: temp1 用户ID temp2 流览IP地址 temp3 online//做了个标记,因为其他功能也要使用这个表 temp4 登陆时间 $onlinetime最长离线时间分钟 db_class是我定义的一个数据库操作类。 /////////////////// //在线统计 $db = new db_class; $db->connect(); $limit_time = time() - ($onlinetime * 60); $online_time = time(); $db->query("delete from gb_temp where (temp4<$limit_time or temp2='$ip') and temp1='$id' and temp3='online'"); //删除离线$onlinetime分钟的用户 $db->query("insert into gb_temp (temp1,temp2,temp3,temp4) values ('$id','$ip','online','$online_time')"); $onres = $db->query("select count(*) from gb_temp where temp1='$id' and temp3='online'"); $onlineuser = $db->fetch_array($onres); $onlineuser = $onlineuser[0]; |
| |
| 您对本文章有什么意见或着疑问吗?请到论坛讨论您的关注和建议是我们前行的参考和动力 |
|
|
| |
上一个文章: 在WIN平台上让你的Apache2.0.45支持PHP
下一个文章: 用ApacheServer配置php,cgi服务器 |
| 【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |