⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 friendaddok.asp

📁 基于ASP开发的聊天室源码
💻 ASP
字号:
<%
if not IsArray(Session("info")) then Response.Redirect "err.asp?kind=20"
info=Session("info")
if InStr(Application("maninfo"),"," & info(0) & ",")<>0 then Response.Redirect "manyou.asp"
addname=Trim(Request.Form("addname"))
addname=Replace(addname,",","")
addname=Replace(addname,";","")
addname=Replace(addname," ","")
addname=Replace(addname,"'","")
addname=Replace(addname,chr(34),"")
addname=Server.HTMLEncode(addname)
if addname="" then Response.Redirect "err.asp?kind=96"
if addname=info(0) then Response.Redirect "err.asp?kind=37"
if InStr(info(13),","&addname&",")<>0 then Response.Redirect "err.asp?kind=36"
if InStr(info(14),","&addname&",")<>0 then Response.Redirect "err.asp?kind=42"
if InStr(Application("zzbird_name"),","&addname&",")=0 then Response.Redirect "err.asp?kind=35"
roominfo=Application("roominfo")
for j=0 to ubound(roominfo)
if InStr(Application("zzbird_name_" & roominfo(j,0)),","&addname&",")<>0 then
towhere=roominfo(j,1)
exit for
end if
next
if towhere="" then Response.Redirect "err.asp?kind=35"
Set Conn=server.createobject("ADODB.CONNECTION")
Conn.Open Application("zzbird_conn")
Set Rs=server.createobject("adodb.recordset")
sql="select * from userinfo where user='" & info(0) & "'"
rs.open sql,conn,1,3
if Rs.Eof and Rs.bof then
 Rs.Close
 Set Rs=Nothing
 Conn.Close
 Set Conn=Nothing
 Response.Redirect "err1.asp?kind=500"
else
 if InStr(Rs("friend"),","&addname&",")<>0 then
 Rs.Close
 Set Rs=Nothing
 Conn.Close
 Set Conn=Nothing
 Response.Redirect "err.asp?kind=36"
 end if
 if InStr(Rs("unfriend"),","&addname&",")<>0 then
 Rs.Close
 Set Rs=Nothing
 Conn.Close
 Set Conn=Nothing
 Response.Redirect "err.asp?kind=42"
 end if
 info(13)=","&addname&info(13)
 Rs("friend")=","&addname&Rs("friend")
 Rs.Update
 Rs.Close
 Set Rs=Nothing
 Conn.Close
 Set Conn=Nothing
 Session("info")=info
 %>
<!--#INCLUDE FILE="function.asp" -->
 <%
 w1=info(0)
 w2=addname
 w3="addfriend"
 w4=server.URLEncode(server.HTMLEncode(Request.Form("word")))
 w5=towhere
 saveword w1,w2,w3,w4,w5
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>加为好友</title>
<style>
<!--
fieldset     { font-size: 10pt }
-->
</style>
</head>
<body bgcolor="buttonface" style="border: 3px double buttonface">

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="46%" id="AutoNumber1" height="62">
  <tr>
    <td width="100%" height="150">
      <fieldset style="padding: 2; width:281; height:142">
      <legend><img border="0" src="images/friend.gif">添加好友</legend>
      消息发送者:<input readonly type="text" name="T1" size="12" value="系统" style="background-color: buttonface"><br>
      <textarea readonly rows="6" name="S1" cols="36" style="border-style: ridge; border-width: 2; background-color: buttonface">你已经成功地把<%=addname%>加为好友。点击“上一步”继续添加其他好友,点击“完成”结束添加。</textarea></fieldset>
    </td>
  </tr>
  <tr>
    <td width="100%" align="right"><input type="button" value="上一步" name="a1" onclick="javascript:history.back(1);"><input type="button" value="下一步" name="a2" disabled>
    <input type="button" value="完成" name="a3" onclick="javascript:window.close();"><input type="button" value="取消" name="a4" disabled></td>
  </tr>
</table>
<script language="javascript">
opener.friendlist="<%=info(13)%>";
opener.showlist();
</script>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -