商讯信箱
用户名: @
密  码:   注册|忘记密码
登录
个人用户经销商
信箱 E杂志
您的位置:首页 > 学院 > 正文       

七、在线访客统计

客户端:

function OnlineNum()

{

     if(objTimeronline)

     {

     loadXML("get","online.asp?frompage="+frompage+"a&b="+b,OnlineNumOk);

     }

     objTimeronline=window.setTimeout("OnlineNum()",2000) ;

}

    

function OnlineNumOk(xmlDom) 

{

     if(document.getElementById("minmain"))

     {

document.getElementById("minmain").innerHTML=xmlDom.responseText;

     }

     }

服务端程序:online.asp

<% Response.Charset="gb2312" %>

<% Session.CodePage=936 %>

<!--#include file="conn.asp"-->

<%

Response.addHeader "pragma", "no-cache"

Response.addHeader "cache-control", "private"

Response.CacheControl = "no-cache"

b=request("b")

if instr(b,"Netscape") then

frompage=StreamToStr(request("frompage"))

else

frompage=del1(request("frompage"))

end if

set rs=server.CreateObject("adodb.recordset")

sql="select * from online where frompage='"&frompage&"'"

rs.open sql,conn,1,3

if not rs.bof or not rs.eof then

onlinenum=rs.recordcount

end if

rs.close

set rs=nothing

conn.close

set conn=nothing

response.write("在线"&onlinenum&"")

%>

1 2 3 4 5 6 7 8 9 10 11 12
有问必答
【内容导航】
第1页:系统功能概述 第2页:界面的实现
第3页:界面效果及位置的实现 第4页:Ajax原理
第5页:数据库规划 第6页:系统登陆
第7页:在线访客统计 第8页:呢称修改功能
第9页:信息发送功能 第10页:信息接收功能
第11页:系统退出 第12页:还原按钮与最小化按钮
©版权所有。未经许可,不得转载。
[责任编辑:罗可龙] [我要挑错]
相关产品
本文相关产品
   没有相关产品