📄 guanzhu.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="const.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="img/Style.css" rel="stylesheet" type="text/css" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {
color: #FFFFFF;
font-weight: bold;
}
.STYLE2 {color: #FFFFFF}
-->
</style>
</head>
<body>
<%
action=Request("action")
user_no=Request.Cookies("zcas")("user_no")
if user_no="" then
Response.Write("<li>登录超时,请重新登录</li>")
Response.End()
end if
if action="update" then
user_no=safeChar(Request.Form("user_no"))
myfriend = replace(safeChar(Request("myfriend")),chr(13),"")
myfriend = replace(myfriend," ","")
if len(myfriend)>220 then
response.Write("<li>输入的字符太多</li>")
Response.End()
end if
y=split(myfriend,"#")
if Ubound(y)>myfriend_max-1 then
Response.Write("输入的好友超出允许的人数: "&myfriend_max)
Response.End()
end if
on error resume next
set c = Server.CreateObject("ADODB.Command")
c.ActiveConnection = dbconn
c.CommandText = "update pc_user set myfriend='"&myfriend&"' where user_no='"&user_no&"'"
c.CommandType = 1
c.CommandTimeout = 0
c.Prepared = true
c.Execute()
if err.number="0" then
Response.Write("<script language='javascript'>alert('添加成功');location=('myfriend.asp')</script>")
else
response.Write("<li>输入的字符太多</li>")
Response.End()
end if
%>
<%else
Dim rs1
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.ActiveConnection = dbconn
rs1.Source = "SELECT user_no,myfriend FROM pc_user where user_no='"&user_no&"'"
rs1.CursorType = 0
rs1.CursorLocation = 2
rs1.LockType = 1
rs1.Open()
if rs1.eof or rs1.bof then
response.Write("系统错误")
response.End()
end if
%>
<p> </p>
<form name="form" action="" method="post" >
<table width="80%" border="0" align="center" cellpadding="1" cellspacing="0" class="atable1">
<tr>
<td colspan="3" bgcolor="#333" class="STYLE2"><span class="STYLE1"> </span><span class="STYLE2">添加关注对象</span></td>
</tr>
<tr>
<td height="30" colspan="3" class="tdmenu"> <span class="jushe">在下面的框中填写关注的好友,填写学号 多个好友时中间以“#”隔开,最后一位好友后面留空.最多个数 [<%=myfriend_max%>] 人</span></td>
</tr>
<tr>
<td width="76%" height="30" class="tdmenu"><div align="center">
<p align="right"><textarea name="myfriend" cols="60" rows="10" class="atable1" id="myfriend"><%=rs1(1)%></textarea>
</p>
<p> </p>
</div></td>
<td width="15%" valign="bottom" class="tdmenu"><div align="center">
<p>
<input name="提交" type="submit" class="tdmenu" id="提交" value="提交" />
</p>
<p>
<input name="重填" type="reset" class="tdmenu" id="重填" value="重填" />
</p>
<input type="hidden" name="action" value="update" />
<input name="user_no" type="hidden" id="user_no" value="<%=rs1(0)%>" />
<p> </p>
</div></td>
<td width="5%" class="tdmenu"> </td>
</tr>
</table>
</form>
<%
rs1.close
set rs1=nothing
end if%>
</body>
</html>
<%dbconn.close%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -