答案:*************************表情设置**************************
<%'optionbq.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_bqq(100)
sc_name = session("ss_name")
set conn = server.createobject("adodb.connection")
conn.open "chat","chat","chat001"
select case request.form("b1")
case "添加表情"
if trim(request.form("t1")) <> "" then
what = replace(trim(request.form("t1")),"<","<")
sql1 = "select * from user_bq_table where (user_name='所有人' and user_bq='" + what + "') or (user_name='" + sc_name +"' and user_bq='" + what + "')"
set rs1 = conn.execute(sql1)
if rs1.eof then
sql = "insert user_bq_table values('" + sc_name +"','" + what + "')"
set rs2 = conn.execute(sql)
sql = "select user_bq from user_bq_table where user_name='所有人' or user_name='" + sc_name + "'"
set rs3 = conn.execute(sql)
for i = 1 to 100
sc_bqq(i) = ""
next
j = 0
do while not rs3.eof
j = j + 1
sc_bqq(j) = rs3(0)
rs3.movenext
loop
session("ss_bq") = sc_bqq
rs3.close
else
rs1.close
end if
end if
case "确认删除"
sql = "delete user_bq_table where user_name='" + sc_name + "' and user_bq='" + request.form("d1") + "'"
set rs2 = conn.execute(sql)
sql = "select user_bq from user_bq_table where user_name='所有人' or user_name='" + sc_name + "'"
set rs3 = conn.execute(sql)
for i = 1 to 100
sc_bqq(i) = ""
next
j = 0
if not rs3.eof then
do while not rs3.eof
j = j + 1
sc_bqq(j) = rs3(0)
rs3.movenext
loop
session("ss_bq") = sc_bqq
rs3.close
end if
end select
sql = "select user_bq from user_bq_table where user_name='" + sc_name + "'"
set rs = conn.execute(sql)
%>
<form method="POST" action="optionbq.asp"
onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
<p>您的新表情:<!--webbot bot="Validation" startspan B-Value-Required="TRUE"
I-Maximum-Length="10" --><!--webbot bot="Validation" endspan --><input type="text"
name="t1" size="13" maxlength="10">(不能超过5个字) <input type="submit"
value="添加表情" name="B1"></p>
<p><%if not rs.eof then%>将<select name="D1" size="1">
<%do while not rs.eof%> <option value="<%response.write(rs(0))%>"><%response.write(rs(0))%></option>
<%
rs.movenext
loop
%> </select>删除<input type="submit" value="确认删除" name="B1"
onclick="document.forms[0].t1.value=' '"></p>
<%
rs.close
end if
conn.close
%>
</form>
</body>
</html>
****************************动作设置*****************************
<%'optionacction.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_acction(100,2)
for i = 1 to 100
sc_acction(i,1) = ""
sc_acction(i,2) = ""
next
set conn=server.createobject("adodb.connection")
conn.open "chat","chat","chat001"
sc_name = session("ss_name")
select case request.form("b1")上一个:我自己写的聊天室源代码(六)
下一个:我自己写的聊天室源代码(八)