<%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
更多推荐
显示在线人数
发布评论