ASP實(shí)例:即時(shí)顯示當(dāng)前頁(yè)面瀏覽人數(shù)_ASP教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:ASP教程:解決ASP腳本運(yùn)行超時(shí)的方法最近在學(xué)習(xí)服務(wù)器知識(shí)。有時(shí)候遇到asp腳本運(yùn)行超時(shí)的錯(cuò)誤,真是麻煩。找了相關(guān)資料,其中有一些解決方法。 IIS默認(rèn)的腳本超時(shí)時(shí)間是90秒 這樣的話如果你是上傳軟件或者傳送數(shù)據(jù)大于90秒的時(shí)
ASP實(shí)現(xiàn)即時(shí)顯示當(dāng)前頁(yè)面瀏覽人數(shù)
online.asp文件
以下為引用的內(nèi)容: <!--#include file="dbconn.asp" --> <% onlineTimeout=10 ''定義在線活動(dòng)時(shí)間的時(shí)間間隔 Function Userip() GetClientIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR") ''''''''''''''''''''''獲得用戶的虛擬IP地址 If GetClientIP = "" or isnull(GetClientIP) or isempty(GetClientIP) Then GetClientIP = Request.ServerVariables("REMOTE_ADDR") ''''''''''如果未使用代理服務(wù)器,就獲得來源的IP地址 End If Userip = GetClientIP End Function sql="select o_id from c_online where o_ip='' "&Userip()&" '' " 在數(shù)據(jù)庫(kù)中查找所獲得 的IP地址的id Set rs=conn.execute(sql) If rs.eof and rs.bof Then sql="insert into c_online(o_ip) values('' "&Userip()&" '')" 如果數(shù)據(jù)庫(kù)中沒有就表明是新IP,那么插入操作 conn.execute(sql) Else sql="update c_online set o_ltime=now() where o_ip='' "&Userip()&" '' " 更數(shù)據(jù)庫(kù)的當(dāng)前時(shí)間 conn.execute(sql) End If sql="delete from c_online where dateadd(''s'',"&onlineTimeout*60&",o_ltime) < now()" 定義十分鐘刷新 conn.execute(sql) rs.close Set rs=nothing Function allonline() tmprs=conn.execute("Select count(o_id) from c_online") allonline=tmprs(0) set tmprs=nothing end Function %> <%Response.Write "document.write(""在線"&allonline()&"人"")"%> |
分享:解決IIS5 HTTP500內(nèi)部錯(cuò)誤一.錯(cuò)誤表現(xiàn) IIS5的HTTP 500內(nèi)部服務(wù)器錯(cuò)誤是我們經(jīng)常碰到的錯(cuò)誤之一,它的主要錯(cuò)誤表現(xiàn)就是ASP程序不能瀏覽但HTM靜態(tài)網(wǎng)頁(yè)不受影響。另外當(dāng)錯(cuò)誤發(fā)生時(shí),系統(tǒng)事件日志和安全事件日志都會(huì)有相應(yīng)
相關(guān)ASP教程:
- asp FSO 讀寫文件本文件實(shí)現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實(shí)IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫(kù)實(shí)現(xiàn)代碼
- asp中正則表達(dá)式過濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁(yè)模板:ASP內(nèi)建對(duì)象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個(gè)小技巧
- eWebEditor v3.8 列目錄
- ASP無組件分頁(yè)實(shí)現(xiàn)思路及代碼
- 相關(guān)鏈接:
復(fù)制本頁(yè)鏈接| 搜索ASP實(shí)例:即時(shí)顯示當(dāng)前頁(yè)面瀏覽人數(shù)
- 教程說明:
ASP教程-ASP實(shí)例:即時(shí)顯示當(dāng)前頁(yè)面瀏覽人數(shù)。