设为首页
加入收藏
站内地图
旧版入口
当前位置:首页 > 站长学院 > 网络编程 > ASP

ASP显示用户是否在线的方法

作者:佚名 出处:网络转载 时间:12-09 点击:

内容载入中...

check.ASP

<script language=javascript>
function Test()
{
var XMLhttp = new ActiveXObject("MSXML2.XMLHTTP");
XMLhttp.open("POST","online.ASP",false); // 向onceonline.ASP发送更新请求
XMLhttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
XMLhttp.send();
}
setInterval("Test();",10); // 10秒钟发送一次更新请求
</script>

online.ASP

<!--#include file="conn.ASP"-->
<%
conn.Execute "update hand_us set i='"&ii&"' where h=true and a='"&request.cookies("login_hand")&"'" '更新最后在线时间
conn.Execute "update hand_us set h=false where datediff('s',i,now())>1" '删除不在线的用户
enddata()
%>

收藏本文:
】【打印页面】【推荐给朋友】【关闭窗口

站长学院

推荐信息