张小倩微博叫什么:防止blog 恶意留言

来源:百度文库 编辑:高校问答 时间:2024/04/30 14:01:00
怎样防止blog 恶意留言?
我用的是2s-space的blog
这个是zblog吗?

你在BLOG中的设置里能不能修改的,如果不行就按下面的这么做。
打开 c_system_event.asp
在 Function PostComment() 下面,加上

Dim SRegExp,Matches,Matches2,Matches3,Matches4
Set SRegExp=New RegExp
SRegExp.IgnoreCase =True
SRegExp.Global=True
SRegExp.Pattern="http"
Set Matches = SRegExp.Execute(Request.Form("inpArticle"))
SRegExp.Pattern="www"
Set Matches2 = SRegExp.Execute(Request.Form("inpArticle"))
SRegExp.Pattern="URL"
Set Matches3 = SRegExp.Execute(Request.Form("inpArticle"))
SRegExp.Pattern="href"
Set Matches4 = SRegExp.Execute(Request.Form("inpArticle"))
If Matches.count>=2 or Matches2.count>=2 or Matches3.count>=4 or Matches4.count>=2 then
Set SRegExp=Nothing
Response.Write "Sorry,you can only input one link"
If isempty(Session("BanIP")) then
Session("BanIP")=1
Else
Session("BanIP")=2
End If
Response.End
End If
Set SRegExp=Nothing
If not isempty(Session("BanIP")) and Session("BanIP")=2 then
Response.Write "Sorry,Your IP is Baned By Our Site."
Response.End
End IF

解释:
如果有人在评论中发布了2个以上的链接,则禁止发布评论,如果仍然发布,则简单Ban掉这个人。

最后修改
2005/12/28
对http,www,URL,href都限制

只能白等