顯示在線人數(shù)
更新時(shí)間:2006年07月09日 00:00:00 作者:
<%
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>當(dāng)前在線 "& online() &"人</font>"& chr(34) & ")"
'Response.Write "document.write(" & chr(34) & " <a href=count/ShowOnline.asp title=查看在線列表><font color=#000000>當(dāng)前在線"& 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 刪除超時(shí)用戶
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>當(dāng)前在線 "& online() &"人</font>"& chr(34) & ")"
'Response.Write "document.write(" & chr(34) & " <a href=count/ShowOnline.asp title=查看在線列表><font color=#000000>當(dāng)前在線"& 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 刪除超時(shí)用戶
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
%>
相關(guān)文章
ASP中常用的22個(gè)FSO文件操作函數(shù)整理
ASP中FSO組件的功能很強(qiáng)大,如果沒有FSO很難想象ASP會(huì)變成什么樣。對(duì)于學(xué)習(xí)asp編程的朋友一定會(huì)接觸到FSO相關(guān)的操作,如備份數(shù)據(jù)庫(kù),讀取文件,生成靜態(tài)頁(yè)面等等。本文就列舉了ASP中常用的22個(gè)FSO文件操作函數(shù),相信能為您帶來方便2020-02-02asp一次性下載遠(yuǎn)程頁(yè)面上的所有內(nèi)容
這篇文章主要介紹了asp一次性下載遠(yuǎn)程頁(yè)面上的所有內(nèi)容,需要的朋友可以參考下2006-06-06如何保持?jǐn)?shù)據(jù)庫(kù)輸出格式不變
如何保持?jǐn)?shù)據(jù)庫(kù)輸出格式不變...2007-02-02利用批處理文件和 vbs 腳本實(shí)現(xiàn)網(wǎng)站視頻自動(dòng)錄制
利用批處理文件和 vbs 腳本實(shí)現(xiàn)網(wǎng)站視頻自動(dòng)錄制...2006-06-06ASP編程入門進(jìn)階(十六):FSO組件之驅(qū)動(dòng)器操作
ASP編程入門進(jìn)階(十六):FSO組件之驅(qū)動(dòng)器操作...2007-01-01給萬博系統(tǒng)的新聞系統(tǒng)增加分頁(yè)功能[配有詳細(xì)說明]
給萬博系統(tǒng)的新聞系統(tǒng)增加分頁(yè)功能[配有詳細(xì)說明]...2007-03-03