asp

位置:IT落伍者 >> asp >> 浏览文章

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


发布日期:2023年07月16日
 
净化网络环境ASP程序实现过滤髒话

<!#include file=/conn/dbconnasp>

<!#include file=/inc/safeasp>

<%

content=Replace_Text(requestForm(content))

content=replace(content<[)

content=replace(content>])

newsid=Replace_Text(requestForm(newsid))

ip=requestForm(ip)

rname=Replace_Text(requestForm(rname))

rname=replace(rname<[)

rname=replace(rname>])

username=Replace_Text(requestForm(username))

username=replace(username<[)

username=replace(username>])

处理发表内容是髒话

set rs=serverCreateObject(adodbrecordset)

sql=select * from badword

rsopen sqlconn

if rseof then

responseWrite(mei ziliao!)

else

on error resume next

do while not rsbof and not rseof

content=replace(contentrsfields(word)value**)

rname=replace(rnamersfields(word)value**)

rsmovenext

loop

end if

rsclose

set rs=nothing

set rs=serverCreateObject(ADODBRecordSet)

sql=select * from pl

rsopen sqlconn

rsaddnew

rs(content)=content

rs(newsid)=newsid

rs(ip)=ip

rs(rname)=rname

rs(username)=username

rsupdate

rsclose

%>

<%

set rsn=serverCreateObject(adodbrecordset)

sqln=select newsidplnumplbz from news where newsid=&newsid&

rsnopen sqlnconn

rsn(plnum)=rsn(plnum)+

rsn(plbz)=

rsnupdate

rsnclose

%>

<script>

alert(成功发布!)

parentlocationshownewsasp?newsid=<%=newsid%>

</script>

               

上一篇:用ASP实现对MP3曲目信息的操作

下一篇:实例应用:用ASP生成二维饼图