当前位置:编程学习 > asp >>

XMLHTTP+Javascript+Asp写得聊天室,无刷新实现。原创代码放送!服务器支持Asp即

########say.asp##############
<% Option Explicit
dim F,T,sC,cL,E,W,sJ
Response.ContentType="text/xml"
F=Request.Form ("F")
T=Request.Form ("T")
sC=Request.Form ("sC")
cL=Request.Form ("cL")
E=Request.Form("E")
'W=Request.Form("W")
W="0"
'发言时间
sJ=getTime()
if Request.ServerVariables("REQUEST_METHOD")="POST" then
sC="<F>"&trim(F)&"</F><T>"&trim(T)&"</T><E>"&E&"</E><sC>"&trim(sC)&"</sC><cL>"&trim(cL)&"</cL><sJ>"&sJ&"</sJ>"
else
Response.End
end if
dim c_info,c_Lid,c_Ip,u_Lid,NewLid,u_name,i
Application.Lock
c_info=Application("c_info")
c_Lid=Application("c_Lid")+1
Application("c_Lid")=c_Lid
c_Ip=(c_info(0)+6) mod 240
c_info(0)=c_Ip
c_info(c_Ip)=c_Lid
c_info(c_Ip+1)=F
c_info(c_Ip+2)=T
c_info(c_Ip+3)=W
c_info(c_Ip+4)=""
c_info(c_Ip+5)=sC '"<F>"&trim(F)&"</F><T>"&trim(T)&"</T><E>"&E&"</E><sC>"&trim(sC)&"</sC><cL>"&trim(cL)&"</cL><sJ>"&sJ&"</sJ>"
Application("c_info")=c_info
Application.UnLock
u_Lid=session("u_Lid")
newLid=u_Lid
u_name=session("u_name")
'&Application("c_Lid")&"%"&c_info(0)
Response.Write "<?xml version=""1.0""?><Msg>"
for i=c_info(0)+6 to 240 step 6
     if (c_info(i)>u_Lid) and ((c_info(i+1)=u_name) or (c_info(i+2)=u_name) or (c_info(i+2)="大家") or (c_info(i+3)="0")) then
    Response.Write c_info(i+5)
补充:asp教程,高级应用
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,