Control <%
Option Explicit
Const admin= "Admin"
Const admpass= "Admin"
Dim roomname,kicklist,onliuser,chatdata,userdup,userid,noplace,username,i,chatpoin,password,admlevel
Username=trim (Request.Form ("username"))
Password=request.form ("password")
Roomname=application ("Roomname")
Kicklist=application ("Kicklist")
Onliuser=application ("Onliuser")
Chatdata=application ("Chatdata")
If Username= "System" or username= "owner" or username= "then Response.Redirect" Error.asp?mess= uses an illegal character as the name or a system-reserved name, please change one "
If Username=admin and Password=admpass then
Admlevel=90
Session ("Admlevel") =9
Username= "*" &username
Else
Admlevel=0
Session ("admlevel") = ""
If InStr (Kicklist, "' #" &username& "") >0 then Response.Redirect "Kickout.htm"
If InStr (Kicklist, "'" &request.servervariables ("REMOTE_ADDR") & "") >0 then Response.Redirect "kickout.htm "
End If
Userdup=false
For I=0 to 50
If Chatdata (i,0) =username Then
If Chatdata (i,1) <>request.servervariables ("REMOTE_ADDR") Then
Response.Redirect "error.asp?mess= the same chat nickname already exists, please enter with another nickname"
Else
Userdup=true
Userid=i
Chatdata (i,4) =admlevel
Exit For
End If
End If
Next
If not Userdup then
For I=0 to 50
If Chatdata (i,0) = "" Then
Userid=i
Chatdata (i,0) =username ' Save user name
Chatdata (i,1) =request.servervariables ("REMOTE_ADDR") ' Save IP Address
Chatdata (i,3) = "" ' Whisper Empty
Chatdata (i,4) =admlevel ' Place do not hit the flexible switch, MIDI switch
Chatdata (i,5) = "" Hide list is empty
Noplace=false
Session ("userid") =i
Exit For
End If
Next
If not Noplace then
onliuser=onliuser& ", '" &username& "" ' Add user to List
For I=0 to 50
Chatdata (i,4) = (chatdata (i,4) mod 4) +4 ' Notify other users to refresh the list
Next
Else
Response.Redirect "error.asp?mess= chat room is full!" "
End If
Else
If InStr (Onliuser, ", '" &username& ") <1 then onliuser=onliuser&", "" &username& ""
End If
Chatpoin=application ("Chatpoin") ' Retains 5 records
If Chatdata (userid,2) >4 Then
Chatdata (userid,2) =chatpoin-5
Else
Chatdata (userid,2) =chatpoin-5+50
End If
Application.Lock
Application ("Chatdata") =chatdata
Application ("Onliuser") =onliuser
Application.UnLock
Session ("Userip") =request.servervariables ("REMOTE_ADDR")
%>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title><% =application ("Roomname")%></title>
<script language= ' JavaScript ' src= ' action.js ' ></script>
<script language= ' JavaScript1.2 ' >
var username= "<% =username%>";
Midisw=false; Music switch
var list=new Array (');
var btitle = '