显示在线人数
程序员文章站
2023-08-24 16:02:22
<%nowurl=request.servervariables("http_referer")username = session("wenday_sys_user...
<%
nowurl=request.servervariables("http_referer")
username = session("wenday_sys_user")
if username="" then
username="客人"
end if
call sqlonline()
response.write "document.write(" & chr(34) & " <font color=#000000>当前在线 "& online() &"人</font>"& chr(34) & ")"
'response.write "document.write(" & chr(34) & " <a href=count/showonline.asp title=查看在线列表><font color=#000000>当前在线"& online() &"人</font></a>"& chr(34) & ")"
sub sqlonline()
dim statuserid
statuserid=replace(request.servervariables("remote_host"),".","")
response.cookies("wenday_sys")("onlineid")=statuserid
sql="select id from "&categoryname&"_online where id="&cstr(request.cookies("wenday_sys")("onlineid"))
set rs=conn.execute(sql)
if rs.eof and rs.bof then
sql="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")&"')"
else
sql="update "&categoryname&"_online set lastimebk=now(),username='"&username&"' where id="&cstr(request.cookies("wenday_sys")("onlineid"))
end if
conn.execute(sql)
set rs=nothing
rem 删除超时用户
sql="delete from "&categoryname&"_online where datediff('s', lastimebk, now()) > "&kicktime&"*60"
conn.execute sql
end sub
function online()
dim tmprs
sql="select count(id) from "&categoryname&"_online"
set tmprs=conn.execute(sql)
online=tmprs(0)
set tmprs=nothing
if isnull(online) then online=0
end function
closedatabase
%>
nowurl=request.servervariables("http_referer")
username = session("wenday_sys_user")
if username="" then
username="客人"
end if
call sqlonline()
response.write "document.write(" & chr(34) & " <font color=#000000>当前在线 "& online() &"人</font>"& chr(34) & ")"
'response.write "document.write(" & chr(34) & " <a href=count/showonline.asp title=查看在线列表><font color=#000000>当前在线"& online() &"人</font></a>"& chr(34) & ")"
sub sqlonline()
dim statuserid
statuserid=replace(request.servervariables("remote_host"),".","")
response.cookies("wenday_sys")("onlineid")=statuserid
sql="select id from "&categoryname&"_online where id="&cstr(request.cookies("wenday_sys")("onlineid"))
set rs=conn.execute(sql)
if rs.eof and rs.bof then
sql="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")&"')"
else
sql="update "&categoryname&"_online set lastimebk=now(),username='"&username&"' where id="&cstr(request.cookies("wenday_sys")("onlineid"))
end if
conn.execute(sql)
set rs=nothing
rem 删除超时用户
sql="delete from "&categoryname&"_online where datediff('s', lastimebk, now()) > "&kicktime&"*60"
conn.execute sql
end sub
function online()
dim tmprs
sql="select count(id) from "&categoryname&"_online"
set tmprs=conn.execute(sql)
online=tmprs(0)
set tmprs=nothing
if isnull(online) then online=0
end function
closedatabase
%>
上一篇: 野菜存放,关于野菜存放你了解多少呢
下一篇: 蕨菜类型分为哪些呢
推荐阅读
-
php截取字符串问题!在线等 在线结贴
-
安卓实现高亮显示文字中的某段文字
-
java - PHP curl模拟POST问题,为什么明明是模拟的是POST,firebug仍显示GET?
-
jquery animate实现鼠标放上去显示离开隐藏效果
-
html中播放swf文件,怎么显示下面的开关面板的部分?_html/css_WEB-ITnose
-
css设置背景图片和背景颜色都不显示_html/css_WEB-ITnose
-
php网页的输入框显示中文错误
-
这段php为何执行完了才在html中显示
-
typecho如何显示分类目录下的文章?
-
Android解决ScrollView下嵌套ListView和GridView中内容显示不全的问题