今天有人上我的blog上发表了空评论和空留言
研究了一下才发现.在评论和留言里只要输入回车就可以提交.
解决方法如下:
========解决空评论的代码================
打开blogcomm.asp
找到以下代码:
if filterSpam(post_Message,"spam.xml") and stat_Admin=false then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>评论中包含被屏蔽的字符</b><br/><a href=""javascript:history.go(-1);"">返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end If
加入以下代码:
if Left(trim(post_Message),1)= Chr(13) then
ReInfo(0)="评论发表错误信息"
ReInfo(1)="<b>评论内容首字符禁止为回车</b><br/><a href=""javascript:history.go(-1);"">返回</a>"
ReInfo(2)="WarningIcon"
postcomm=ReInfo
exit function
end if
================这一个是禁止空留言的==================
打开Plugins\GuestBook\bookaction.asp
找到以下代码:
if filterSpam(post_Message,"../../spam.xml") and stat_Admin=false then
showmsg "留言发表错误信息","<b>留言中包含被屏蔽的字符</b><br/><a href=""javascript:history.go(-1);"">返回</a>","WarningIcon","plugins"
exit function
end if
加入以下代码:
if Left(trim(post_Message),1)= Chr(13) then
showmsg "留言发表错误信息","<b>留言内容首字符禁止为回车</b><br/><a href=""javascript:history.go(-1);"">返回</a>","WarningIcon","plugins"
exit function
end If
其实加入在哪里比较灵活,这里只是方便给不懂的人看.
出自:
http://www.sweethoney.cn
原文地址:
http://www.sweethoney.cn/article.asp?id=80
[
本帖最后由 shell 于 2006-10-31 04:09 编辑 ]