显示在线人数

编程入门 行业动态 更新时间:2024-10-26 02:34:53
<%nowurl=request.servervariables("http_referer")username = session("wenday_sys_user")if username="" then username="客人"end ifcall sqlonline()response.write "document.write(" & chr(34) & "<font color=#000000>当前在线 "& online() &"人</font>"& chr(34) & ")"'response.write "document.write(" & chr(34) & "<a title=查看在线列表><font color=#000000>当前在线"& online() &"人</font></a>"& chr(34) & ")"sub sqlonline()dim statuserid statuserid=replace(request.servervariables("remote_host"),".","") response.cookies("wenday_sys")("onlineid")=statuseridsql="select id from "&categoryname&"_online where id="&cstr(request.cookies("wenday_sys")("onlineid"))set rs=conn.execute(sql)if rs.eof and rs.bof thensql="insert into "&categoryname&"_online(id,username,ip,startime,lastimebk,browser,actforip,now_url) values ("&statuserid&",'"&username&"','"&request.servervariables("remote_host")&"',now(),now(),'"&request.servervariables("http_user_agent")&"','"&request.servervariables("http_x_forwarded_for")&"','"&request.servervariables("http_referer")&"')"elsesql="update "&categoryname&"_online set lastimebk=now(),username='"&username&"' where id="&cstr(request.cookies("wenday_sys")("onlineid"))end ifconn.execute(sql)set rs=nothingrem 删除超时用户sql="delete from "&categoryname&"_online where datediff('s', lastimebk, now()) > "&kicktime&"*60"conn.execute sqlend subfunction online()dim tmprssql="select count(id) from "&categoryname&"_online"set tmprs=conn.execute(sql) online=tmprs(0) set tmprs=nothing if isnull(online) then online=0end function closedatabase%>
  • 0
  • 0
  • 0
  • 0
  • 0

更多推荐

显示在线人数

本文发布于:2023-06-10 22:50:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/620772.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:在线   人数

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!