主動離開:leave.asp
<%
response.expires=0
sendid=session("userid")
if sendid<>"" then
chatdata=application("chatdata")
onliuser=application("onliuser")
if chatdata(sendid,1)=request.servervariables("remote_addr") then '驗證使用者IP地址
onliuser=replace(onliuser,",'"&chatdata(sendid,0)&"'","")
for i=0 to 50
chatdata(i,4)=(chatdata(i,4) mod 4) +4 '通知更新名單
next
chatdata(sendid,0)="" '清空使用者名稱
chatdata(sendid,1)="" '清空Ip地址
chatdata(sendid,3)="" '清空私聊內容
chatdata(sendid,4)=0 '清空許可權和音樂開關及免打撓開關
chatdata(sendid,5)="" '清空隱藏名單
application.lock
application("chatdata")=chatdata
application("onliuser")=onliuser
application.unlock
end if
end if
session("userid")=""
response.redirect "login.asp"
function finduser(fuser)
reval=100
for i=0 to 99
if chatdata(i,0)=fuser then
reval=i
exit for
end if
next
finduser=reval
end function
%>
被動離開:kickout.htm
<script language="JavaScript">
<!--
if (self.parent.frames.length != 0)top.location=document.location.href;
// -->
</script>
<br><br><br><center><font size=5>你被這個聊天室的管理員踢出了本聊天室</font></center>