一个BBS的源代码(五)
'==================================================================================================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
补充:asp教程,高级应用