净化网络环境 ASP程序实现过滤脏话


 

<!--#include file="../conn/dbconn1.asp"-->
<!--#include file="../inc/safe.asp"-->
<%
content=Replace_Text(request.Form("content"))
content=replace(content,"<","[")
content=replace(content,">","]")

newsid=Replace_Text(request.Form("newsid"))
ip=request.Form("ip")
rname=Replace_Text(request.Form("rname"))
rname=replace(rname,"<","[")
rname=replace(rname,">","]")
'username=Replace_Text(request.Form("username"))
'username=replace(username,"<","[")
'username=replace(username,">","]")

'处理发表内容是脏话
set rs=server.CreateObject("adodb.recordset")
sql="select * from badword"
rs.open sql,conn,3,3
if rs.eof then
response.Write("mei ziliao!")
else

on error resume next
do while    not rs.bof and not rs.eof
content=replace(content,rs.fields("word").value,"**")
rname=replace(rname,rs.fields("word").value,"**")
rs.movenext
loop
end if
rs.close
set rs=nothing
''''''''''''''''''''''''''''''
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from pl"
rs.open sql,conn,3,3
rs.addnew
rs("content")=content
rs("newsid")=newsid
rs("ip")=ip
rs("rname")=rname
rs("username")=username
rs.update
rs.close
%>
<%
set rsn=server.CreateObject("adodb.recordset")
sqln="select newsid,plnum,plbz from news where newsid="&newsid&""
rsn.open sqln,conn,1,3
rsn("plnum")=rsn("plnum")+1
rsn("plbz")=1
rsn.update
rsn.close
%>
<script>
alert("成功发布!")
parent.location.href="shownews.asp?newsid=<%=newsid%>"
</script>

本文作者:



相关阅读:
IE6不支持position:fixed bug的完美解决
动态修改DOM 里面的 id 属性的弊端分析
php 随机排序广告的实现代码
Vista系统内存加速技巧
网页特效从下往上过渡 共享图库_最新图片
ubuntu语音交互控制初体验(gnome voice control)
Asp.net Mvc Framework 十二 Castle扩展
css ID类和class类的长命名与短命名
Asp.net代码不紧凑带来的祸害
ORA-12714错误解决总结
批处理删除自身的命令小结
使用Delphi6的DBExpress组件连接远程的Mysql数据库
详细讲解MySQL 4.1数据如何转换
JavaScript Break 和 Continue区别教程
快速导航

Copyright © 2016 phpStudy |