'================================ Case "Add","Reply" '================================ ' 把文章加进数据库
' 检查数据 Userid = Trim(Request("Userid")) Password = Trim(Request("Password")) Title = Trim(Request("Title")) Content = Rtrim(Request("Content")) If Request("Mailme") = "Yes" Then Mailme = 1 Else Mailme = 0
WrongMsg = "" If Userid = "" Then WrongMsg = WrongMsg + "<DD><LI>请输入你的账号。" If Password = "" Then WrongMsg = WrongMsg + "<DD><LI>请输入你的密码。" If Title = "" Then WrongMsg = WrongMsg + "<DD><LI>请输入文章题目。" If Content = "" Then WrongMsg = WrongMsg + "<DD><LI>请输入内容。"
If WrongMsg = "" Then
Userid = SqlStr( Userid ) Password = SqlStr( Password ) Title = SqlStr( Title ) Content = SqlStr( Content )
' 检察账号与密码 SQL = "SELECT COUNT(*) FROM bbsmember WHERE [账号]='" & Userid & "' AND [密码]='" & Password & "'" RecMember.Open SQL , Con , 1 If RecMember.Fields(0).Value = 0 Then MemberExist = True Else MemberExist = False RecMember.Close
If MemberExist Then
WrongMsg = WrongMsg + "<DD><LI>用户名不存在或者密码不对。"
Else ' 加进数据库
If Job = "Add" Then SQL = "INSERT INTO bbs ([作者],[题目],[内容],[邮件通知]) VALUES('" &_ SqlStr( Userid ) & "','" &_ SqlStr( Title ) & "','" &_ SqlStr( Content ) & "'," &_ Mailme & ")" Else ' 回复文章数加一 Con.Execute( "UPDATE bbs SET [回复]=[回复]+1 WHERE [序号]=" & session("BBS_Which") )
' ' 邮件通知原作者 ' SQL = "SELECT [题目],[时间],[邮件通知] FROM bbs WHERE [序号]=" & Session("BBS_Which") RecBBS.Open SQL , Con , 1 If RecBBS.Fields("邮件通知") Then