一个BBS的源代码(五)

2018-09-06 12:10

阅读:426

  =================================
Case Modify
================================
修改文章

Which = Request(Which)
WhichID = GetID( Which )

If Left( Which , 1 ) = E Then Table = bbs Else Table = bbsreply

WrongMsg =

If Request(Modify) = Yes Then

Userid = Request(Userid)
Password = Request(Password)
Title = Trim(Request(Title))
Content = Rtrim(Request(Content))

If Title = \ Then WrongMsg = WrongMsg + <DD><LI>题目不能为空。</LI>
If Content = Then WrongMsg = WrongMsg + <DD><LI>内容不能为空。</LI>

If WrongMsg = Then
RecBBS.Open SELECT [作者] FROM Table WHERE [序号]= WhichID , Con , 1
If RecBBS.Fields(作者) = Userid Then
SQL = SELECT COUNT(*) FROM bbsmember WHERE [账号]= SqlStr(Userid) AND [密码]= SqlStr(Password)
RecMember.Open SQL , Con , 1
If RecMember.Fields(0) > 0 Then
SQL = UPDATE Table SET [题目]= SqlStr(Title) ,[内容]= SqlStr(Content) WHERE [序号]= WhichID
Con.Execute( SQL )
Else
WrongMsg = <DD><LI>密码不正确。</LI>
End If
RecMember.Close
Else
WrongMsg = <DD><LI>用户名不正确。</LI>
End If
RecBBS.Close
End If

End If

Title = \
Content =

SQL = SELECT [题目],[内容] FROM Table WHERE [序号]= WhichID
RecBBS.Open SQL , Con , 1

If Not RecBBS.EOF Then
Title = RecBBS.Fields(题目)
Content = RecBBS.Fields(内容)
End If
RecBBS.Close
%>
<TABLE align=center border=0 cellPadding=1 cellSpacing=0 width=650>
<TR>
<TD class=menu>
<A href=/>飞林庄</A>-gt;<A href=<%= ASP_FILE_NAME %>>经验交流</A>-gt;<A href=<%= ASP_FILE_NAME %>?Job=ContentWhich=<%= Session(BBS_Which) %>><%= Session(BBS_WhichTitle) %></A>
<% If WrongMsg <> Then %>
<BR><BR>修改失败!<BR><BR>
<%= WrongMsg %><BR>
<% Else %>
<BR><BR>修改成功!<BR><BR>
<% End If %>
<FORM action=<%= ASP_FILE_NAME %> method=post>
<INPUT type=hidden name=Job value=Modify>
<INPUT type=hidden name=Modify value=Yes>
<INPUT type=hidden name=Which value=<%= Which %>>
账号:<INPUT type=text id=Userid name=Userid size=30 maxlength=80><BR>
密码:<INPUT type=password id=Password name=Password size=30 maxlength=80><BR><BR>
题目:<INPUT type=text id=Title name=Title value=<%= Title %>>
<TEXTAREA id=Content name=Content cols=80 rows=16><%= Content %></TEXTAREA><BR>
<INPUT type=submit value=确认修改>
</FORM>
</TD>
</TR>
</TABLE>

<%
===============================
Case Apply
===============================
申请账号
%>

<TABLE align=center border=0 cellPadding=7 cellSpacing=0 width=650>
<TR>
<TD class=menu>
<FORM action=<%= ASP_FILE_NAME %> method=POST>
<INPUT type=hidden name=Job value=Adduser>
<P>飞林庄-gt;经验交流-gt;注册账号</P>


评论


亲,登录后才可以留言!