我自己写的聊天室源代码(八)
发表于:2007-06-30来源:作者:点击数:
标签:
************************不能进入聊天室************************* %‘’nochat.asp% html head meta http-equiv=Content-Type content=text/html; charset=gb2312 title不能进入聊天室/title meta name=GENERATOR content=Microsoft FrontPage 3.0 meta nam
************************不能进入聊天室*************************
<%‘’nochat.asp%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>不能进入聊天室</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
</head>
<body>
<p><img src="images/ff/boy00.gif" width="110" height="220"><big><big><big><font
face="隶书" color="#FF00FF"><%response.write(session("ss_nowwhat"))%></font></big></big></big></p>
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan --><div
align="center"><center><p><input type="button" value="重新登录" name="B1"
onclick="parent.location.href=‘’default.asp‘’"><input type="button" value="不玩了"
name="B2" onclick="window.close()"></p>
</center></div>
</form>
</body>
</html>
**************************聊天室***************************
<%‘’chat.asp%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>聊天室</title>
<meta name="Microsoft Border" content="tl, default">
</head>
<frameset framespacing="0" border="false" frameborder="0" rows="75%,25%,0">
<frameset cols="80%,20%">
<frame name="topleft" scrolling="yes" src="hearall.asp">
<frame name="topright" src="online.asp" scrolling="auto">
</frameset>
<frameset cols="80%,20%">
<frame name="midleft" src="say.asp" scrolling="auto">
<frame name="midright" src="myoption.asp" scrolling="no">
</frameset>
<frame name="bottom" scrolling="auto" noresize target="contents" src="new.asp">
<noframes>
<body>
<p>This page uses frames, but your browser doesn‘’t support them.
</body>
</noframes>
</frameset>
</html>
****************************被赶出聊天室****************************
<%‘’goout.asp%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>被赶出聊天室</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
</head>
<body>
<p align="center"><img src="images/ff/man/casasellerb.gif" width="140" height="160"
alt="casasellerb.gif (5914 bytes)"><font color="#FF0000"><big><big>您被踢出聊天室!稍候请登录!!</big></big></font></p>
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan --><div
align="center"><center><p><input type="button" value="不好意思" name="B1"
onclick="window.close();"></p>
</center></div>
</form>
</body>
</html>
*******************************浏览所有人*****************************
<%‘’hearall.asp%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>浏览所有人</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<meta name="Microsoft Border" content="none">
<meta name="Microsoft Theme" content="none">
</head>
<body>
</body>
</html>
********************************在线列表******************************
<%‘’online.asp%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>在线列表</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
<script language="
JavaScript"><!--
function tt(text)
{
parent.midleft.document.forms[0].who.value = text;
return true;
}
// --></script>
</head>
<body background="images/bg05.gif">
<a href="say.asp" target="midleft">
<p>所有人</a> <%
dim sc_user,sc_usernum
application.lock
sc_user = application("ap_user")
sc_usernum = application("ap_usernum")
application.unlock
dim sc_img,sc_friend,sc_colloruser
sc_friend = session("ss_friend")
for i = 1 to 30
if trim(sc_user(i,1)) <> "" then
sc_img = "<img src=‘’" + sc_user(i,6) +"‘’ WIDTH=‘’20‘’ HEIGHT=‘’20‘’>"
response.write("<br>"+sc_img)
for j = 1 to 100
if sc_user(i,1) = sc_friend(j) then
sc_colloruser = "<a href=‘’say.asp?name=" + sc_user(i,1) + "‘’ target=‘’midleft‘’>" + "<font color=‘’#FF00FF‘’>" + sc_user(i,1) + "</font>{<small>" + sc_user(i,8) + "</small>}</a>"
exit for
else
sc_colloruser = "<a href=‘’say.asp?name=" + sc_user(i,1) + "‘’ target=‘’midleft‘’>" + sc_user(i,1) + "{<small>" + sc_user(i,8) + "</small>}</a>"
end if
next
response.write(sc_colloruser)
end if
next%> </p>
</body>
</html>
*************************说***************************
<%‘’say.asp%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>说</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
</head>
<script language="
javascript">
<!--
function formsubmit()
{
document.forms[0].what1.value = document.forms[0].what.value;
document.forms[0].what.value = "";
windowload();
return true;
}
function windowload()
{
document.forms[0].what.focus();
return true;
}
function dd(list)
{
var listtext="";
if ((list.selectedIndex != -1)&&(list.selectedIndex != 0))
listtext = list.options[list.selectedIndex].value;
return listtext;
}
function dd1()
{
var listtext="";
listtext = document.forms[0].who.value;
return listtext;
}
function getme()
{
var mme="";
mme = document.forms[0].me.value;
return mme;
}
function msg(tt)
{
alert(tt);
windowload();
}
function out(tt)
{
document.forms[0].what.value = tt;
document.forms[0].a
clearcase/" target="_blank" >cction.value = "1";
document.forms[0].what.focus();
}
//-->
</script>
<script language="
VBScript"><!--
function cc(list)
dim sc_listtext,sc_who,sc_me,sc_he
sc_listtext = dd(list)
sc_who = dd1()
if trim(sc_who) = "所有人" then
msg("你要对谁做动作呢??")
else
sc_me = getme()
sc_listtext = replace(sc_listtext,"#1",sc_me)
sc_listtext = replace(sc_listtext,"#2",sc_who)
out(trim(sc_listtext))
end if
end function
--></script>
<body onload="windowload();" background="images/bg05.gif">
<%sc_ww1 = request("sc_ww")%>
<form method="POST" action="new.asp" target="bottom" language="javascript"
onsubmit="formsubmit()">
<input type="hidden" name="acction" value="0"><input type="hidden" name="me"
value="<%response.write(session("ss_name"))%>"><input type="hidden" name="what1" value=" "><table
border="0" width="100%" cellspacing="0">
<tr>
<
td width="100%" colspan="4"><div align="right"><p>您对<select name="who" size="1"
onchange="windowload();">
<option selected value="所有人">所有人</option>
<%
sc_user = application("ap_user")
for i= 1 to 30
if trim(sc_user(i,1))<>"" then
if trim(sc_user(i,1))=trim(request("name")) then
%> <option selected value="<%response.write(sc_user(i,1))%>"><%response.write(sc_user(i,1))%></option>
<%
else%> <option value="<%response.write(sc_user(i,1))%>"><%response.write(sc_user(i,1))%></option>
<%
end if
end if
next%> </select>说:<input type="text" name="what" size="43" value="<%response.write(sc_ww1)%>"><input
type="submit" value="提交" name="B1"><input type="button" value="清除" name="B2"
onclick="document.forms[0].what.value=‘’‘’;document.forms[0].what.focus();"></td>
</tr>
<tr>
<td width="10%"><div align="center"><center><p><%if session("ss_qq") = "5" then%><input type="checkbox" name="C1" value="ON"
checked> <%else%><input type="checkbox" name="C1" value="ON"><%end if%> <input type="text" name="T3"
size="6" value="悄悄话"></td>
<td width="30%" align="center"><div align="center"><center><p>表情:<select name="bq"
size="1" onchange="windowload();">
<option selected value=" ">面无表情</option>
<%sc_bq = session("ss_bq")
sc_bq1 = session("ss_bq1")
for i = 1 to 100
if trim(sc_bq(i))<>"" then
if trim(sc_bq(i)) = trim(sc_bq1) then%> <option selected value="<%response.write(sc_bq(i))%>"><%response.write(sc_bq(i))%></option>
<% else%> <option value="<%response.write(sc_bq(i))%>"><%response.write(sc_bq(i))%></option>
<% end if
end if
next%> </select></td>
<td width="50%" align="center"><div align="center"><center><p>动作:<select
name="action" size="1" onchange="cc(this)">
<option selected value="没有动作">没有动作</option>
<%
sc_acction = session("ss_acction")
for i = 1 to 100
if trim(sc_acction(i,1))<>"" then%> <option value="<%response.write(sc_acction(i,2))%>"><%response.write(sc_acction(i,1))%></option>
<%
end if
next
%> </select></td>
<td width="10%" align="center"><div align="right"><p><select name="color" size="1"
onchange="windowload();">
<option selected value="#000000">默认颜色</option>
<option value="#FF0000">红色</option>
</select></td>
</tr>
<tr align="center">
<%if ((session("ss_userflag") = 0) or (session("ss_userflag") = 1)) then%>
<td width="100%" align="center" colspan="4"><div align="right"><p>时长:<input
type="text" name="time1" size="6"><input type="submit" value="踢人" name="B1"><input
type="submit" value="封闭聊天" name="B1"><input type="submit" value="封闭浏览"
name="B1"></td>
<%end if%>
</tr>
<tr align="center">
<%if (session("ss_userflag") = 0) then%>
<td width="33%" align="center"><a href="loseallhaha.asp" target="_blank">输出系统参数</a></td>
<td width="33%" align="center"><a href="clearall.asp" target="_blank">重置系统参数</a></td>
<td width="34%" align="center" colspan="2"><a href="userflag.asp" target="_blank">用户权限修改</a></td>
<%end if%>
</tr>
</table>
</form>
</body>
</html>
***************************个人设置*****************************
<%‘’myoption.asp%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>个人设置</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
</head>
<body background="images/bg05.gif">
<table border="0" width="100%" cellspacing="0">
<tr>
<td width="100%"><a href="optionfriend.asp" target="_blank">朋友设置</a></td>
</tr>
<tr>
<td width="100%"><a href="optionbq.asp" target="_blank">表情设置</a></td>
</tr>
<tr>
<td width="100%"><a href="optionacction.asp" target="_blank">动作设置</a></td>
</tr>
<tr>
<td width="100%"><a href="optioninout.asp" target="_blank">进入/退出</a></td>
</tr>
</table>
</body>
</html>
****************************朋友设置************************
<%‘’optionfriend.asp%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>朋友设置</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<meta name="Microsoft Theme" content="none, default">
<meta name="Microsoft Border" content="none">
</head>
<body>
<%dim sc_user1(30),sc_allfriend(100),sc_friend(30),sc_user,sc_other(30)
dim sc_count
set conn=server.createobject("adodb.connection")
conn.open "chat","chat","chat001"
sc_name = session("ss_name")
sc_user = application("ap_user")
for i = 1 to 30
sc_user1(i) = sc_user(i,1)
sc_friend(i) = ""
sc_other(i) = ""
next
for i = 1 to 100
sc_allfriend(i) = ""
next
select case request.form("b1")
case "删除"
sql2 = "delete user_friend_table where user_name=‘’" + session("ss_name") + "‘’ and user_friend = ‘’" + request.form("d1") + "‘’"
set rs2 = conn.execute(sql2)
sql1 = "select user_friend from user_friend_table where user_name=‘’" + sc_name + "‘’"
set rs = conn.execute(sql1)
j = 0
if not rs.eof then
do while not rs.eof
j = j + 1
sc_allfriend(j) = rs(0)
rs.movenext
loop
rs.close
end if
case "添加"
sql3 = "insert user_friend_table values(‘’" + session("ss_name") + "‘’,‘’" + request.form("d2") + "‘’)"
set rs3 = conn.execute(sql3)
sql1 = "select user_friend from user_friend_table where user_name=‘’" + sc_name + "‘’"
set rs = conn.execute(sql1)
j = 0
if not rs.eof then
do while not rs.eof
j = j + 1
sc_allfriend(j) = rs(0)
rs.movenext
loop
rs.close
end if
end select
sql1 = "select user_friend from user_friend_table where user_name=‘’" + sc_name + "‘’"
set rs = conn.execute(sql1)
j = 0
if not rs.eof then
do while not rs.eof
j = j + 1
sc_allfriend(j) = rs(0)
rs.movenext
loop
rs.close
end if
session("ss_friend") = sc_allfriend
if 5*int(j/5) < j then
sc_count = int(j/5) + 1
else
sc_count = int(j/5)
end if
k = 0
l = 0
for i = 1 to 30
if sc_user1(i) <> "" then
flag = 0
for j = 1 to 100
if trim(sc_user1(i)) = trim(sc_allfriend(j)) then
k = k + 1
sc_friend(k) = sc_user1(i)
flag = 1
exit for
end if
next
if flag = 0 then
l =l + 1
sc_other(l) = sc_user1(i)
end if
end if
next
%>
<form method="POST" action="optionfriend.asp">
<p>你的所有朋友:</p>
<table border="0" width="100%" cellspacing="0">
<%for i = 1 to sc_count%>
<tr>
<td width="20%" align="center"><%response.write(sc_allfriend((i-1)*5 + 1))%>
</td>
<td width="20%" align="center"><%response.write(sc_allfriend((i-1)*5 + 2))%>
</td>
<td width="20%" align="center"><%response.write(sc_allfriend((i-1)*5 + 3))%>
</td>
<td width="20%" align="center"><%response.write(sc_allfriend((i-1)*5 + 4))%>
</td>
<td width="20%" align="center"><%response.write(sc_allfriend((i-1)*5 + 5))%>
</td>
</tr>
<%next%>
</table>
<p><%if trim(sc_friend(1)) <> "" then%>将<select name="D1" size="1">
<%for i = 1 to 30
if trim(sc_friend(i)) <> "" then
%> <option value="<%response.write(sc_friend(i))%>"><%response.write(sc_friend(i))%></option>
<%
end if
next%> </select>从朋友列表中删除<input type="submit" value="删除" name="B1"><%end if%></p>
<p><%if trim(sc_other(1)) <> "" then%>将<select name="D2" size="1">
<%for i =1 to 30
if trim(sc_other(i)) <> "" then
%> <option value="<%response.write(sc_other(i))%>"><%response.write(sc_other(i))%></option>
<%
end if
next%> </select>添加到朋友列表中<input type="submit" value="添加" name="B1"></p>
<%end if%>
</form>
<%conn.close%>
</body>
</html>
原文转自:http://www.ltesting.net