您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP实例:精确到每一秒钟的在线人数显示代码

2024/2/20 9:07:49发布20次查看
300)¦¦($tmptime{
$online_time=date(y-m-d h:i:s);
$str=replace lt_t_online set lt_username='$username',lt_lasttime=now();//写入数据库
$res=mysql_query($str);
}
?>
以上文件每分钟自动刷新一次
以下是5分钟运行一次的守护进程
$str = delete from lt_t_online where unix_timestamp(now())-unix_timestamp(lt_lasttime)>300;
mysql_query($str);
?>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product