chat.asp——主帧控制文件
<%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="系统" or username="所有人" or username="" then response.redirect "error.asp?mess=使用了非法的字符为名字或使用了系统保留的名名,请换一个再进"
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=相同的聊天昵称已存在,请你用另一个昵称进入"
else
userdup=true
userid=i
chatdata(i,4)=admlevel
exit for
补充:asp教程,高级应用