Xmlhttp+javascript+asp Write chat room, no refresh implementation (iv)

Source: Internet
Author: User
Tags date end trim
javascript|xml| Chat Room | refresh | no refresh
####### #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"
' Speaking time
Sj=gettime ()
If Request.ServerVariables ("request_method") = "POST" Then
Sc= "" &trim (F) & "" &trim (T) & "" &E& " "&trim (SC) &" "&trim (CL) &" "&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 ' "" &trim (F) & "" &trim (T) & "" & e& "" &trim (SC) & "" &trim (CL) & "" &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 ""
For I=c_info (0) +6 to 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) = "Everyone") or (C_info (i+3) = "0")) Then
Response.Write C_info (i+5)
if (NewlidEnd If
Next
For I=1 to C_info (0) 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) = "Everyone") or (C_info (i+3) = "0")) Then
Response.Write C_info (i+5)
if (NewlidEnd If
Next

Response.Write ""
Session ("U_lid") =newlid

function GetTime ()
Dim y,m,d,h,n,s
Y=year (date ())
M=month (date ())
D=day (date ())
H=hour (Time ())
N=minute (Time ())
S=second (Time ()) ' When it is one, add 0 to the front
If Len (m) =1 then m= "0" & M
If Len (d) =1 then d= "0" & D
If Len (h) =1 then h= "0" & H
If Len (n) =1 then n= "0" & N
If Len (s) =1 then s= "0" & S
gettime=y& "/" &m& "/" &d & "" & h& ":" & n& ":" &s
End Function%>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.