因为有些留言的内容有部分需要屏蔽,所以做了如附件图片上的效果出来,修改了admin/KS.GuestBook.asp的部分代码:
'回复留言
Sub GuestReply()
Dim Flag, pagetxt, useridtxt, ssubject, sanser, sadminhead, scheckbox, smemo(这个是新加的), sansertime,SqlStr,RSObj
Dim DomainStr:DomainStr= KS.GetDomain
Flag =KS.G("Flag")
pagetxt = Request("cpage")
useridtxt = Request("userid")
if Flag="ok" then
ssubject =KS.G("txtcontop")
sanser = KS.G("txtanser")
sadminhead = KS.G("adminhead")
scheckbox = KS.G("htmlok")
smemo = KS.G("txtmemo")(这个是新加的)
sansertime = Now()
SqlStr=" UPDATE KS_GuestBook SET AnserTime='" & sansertime & "',AdminHead='" & sadminhead & "',Anser='" & sanser &"',Memo='" & smemo &"'(这个是新加的),Verific=1 WHERE ID=" & useridtxt
Conn.Execute SqlStr
set Conn = nothing
Response.Redirect "KS.GuestBook.asp?page=" & pagetxt
End If
Set RSObj=Server.CreateObject("Adodb.Recordset")
SqlStr="SELECT * FROM KS_GuestBook WHERE ID="&useridtxt
RSObj.Open SqlStr,Conn,1,1
显示留言内容的代码也做出了如下修改:
<td colspan="2" align="center" height="14">:::::::::::::::::::::::::::::::::::: 留 言 内 容 ::::::::::::::::::::::::::::::::::::</td>
</tr>
<tr>
<td width="18%" align="center" height="32"><img src="<%=DomainStr%>Images/face/<%=RSObj("Face")%>"><br><%=RSObj("Name")%></td>
<td>
<textarea rows="8" name="txtmemo" cols="60" class="inputmultiline"><%=KS.HTMLCode(RSObj("Memo"))%></textarea>
</td>
但是提交后出现了:
错误类型:
Microsoft JET Database Engine (0x80040E14)
UPDATE 语句的语法错误。
/admin/KS.GuestBook.asp, 第 360 行
请教各位高手应该怎么解决?
此主题相关图片如下:2副本.jpg