首页 | 心情日记 | 建站心得 | 编程技术 | 大盘分析 | 股市信息 | 学习园地 | 电脑技巧 | 物流外贸 | 另类其它 | 站长推荐 | 给我留言 | 相册

用户登陆
用户:
密码:
 
不保存保存一天
保存一月保存一年

站点日历
73 2024 - 4 48
 123456
78910111213
14151617181920
21222324252627
282930


站点统计

最新评论

日志搜索

 标题   内容


综合的判断用户输入的合法性的函数 改进性能和样式的 24个 ASP 技巧
未知 提交信息关键字过滤类源码   [ 日期:2006-09-25 16:57:22 ]   [ 来自:本站原创 ]

海外邮件中继,海外退信中继,美国高速VPS,不限流量VPN,邮局维护和管理,邮件网关,EMOS邮件中继,POSTFIX邮件中继,Winwebmail邮件中继,Winmail邮件中继,DBMail邮件中继,JDMail邮件中继,Exchange邮件中继,MDaemon邮件中继 淘宝店:http://shantan.taobao.com 云邮科技官网:www.yunrelay.com

【字体设置:
<%
'Cnxhacker.Net 全站系统文章和提交信息关键字过滤类源码
'Cnxhacker.Net 奇奇编写

'转贴请保留此信息,注释信息会被解释程序忽略,这不会对脚本的执行速度和程序整体性能造成任何影响,谢谢!


'Add <!--#include file=""filtration.asp""--> to the start of any page on which you want to call the function.

'First, please specify some key words to filtrate and pass to Waiting, separate each with ""|"".
'BE CAREFUL: No need to add another ""|"" at the end of the string.
Waiting=""Fa轮功|电影""

'If you want to give out a warning to cover it all when the above keywords are seen, specify the warning message here, one after another, separated by ""|"".
WaitingtoCover=""[提交的信息被过滤!!请勿在此提交广告或非法信息!!!]""

'If you want the above keywords to filtrate to be taken place, specify the string with which you want to cover it.
WaitingA=""中国气功万岁!|动画片""


'WARNING: The length of any of the specified keywords to filtrate CANNOT be zero or null.

dim sa(),sb(),sc()
dim ctra,ctrb,ctrc

'OK. Everything is ready, Let's begin.
lengtha=len(waiting)
if mid(waiting,lengtha,1) =""|"" then
waiting=left(waiting,lengtha-1)
lengtha=lengtha-1
end if

lengthb=len(waitinga)
if mid(waitinga,lengthb,1) =""|"" then
waitinga=left(waiting,lengthb-1)
lengthb=lengthb-1
end if

lengthc=len(waitingtocover)

ctra=0:ctrb=0:ctrc=0

for i=1 to lengtha
if mid(waiting,i,1)=""|"" then ctra=ctra+1
next
redim preserve sa(ctra+1)

for i=1 to lengthb
if mid(waitinga,i,1)=""|"" then ctrb=ctrb+1
next
redim preserve sb(ctrb+1)

ctraa=0
for i=1 to lengtha
if mid(waiting,i,1)<>""|"" then
temps=temps+mid(waiting,i,1)
else
ctraa=ctraa+1
sa(ctraa)=temps
temps=""""
if ctraa=ctra then
ctraa=ctraa+1
sa(ctraa)=right(waiting,lengtha-i)
end if
end if
next

ctrbb=0
temps=""""
for i=1 to lengthb
if mid(waitinga,i,1)<>""|"" then
temps=temps+mid(waitinga,i,1)
else
ctrbb=ctrbb+1
sb(ctrbb)=temps
temps=""""
if ctrbb=ctrb then
ctrbb=ctrbb+1
sb(ctrbb)=right(waitinga,lengthb-i)
end if
end if
next

'Call filtrate(filtration), ""filtration"" is the source string that you want to have which filtrate, to return a string after filtration.
'You have two choices to filtrate a string:
'1. To change the keywords you want to filtrate to others;
'2. To cover all if any of the specified keywords exists.

'Specify type of filtration, directly pass the value to ""typetofil"" when calling the function.
'Space is processed as """".
function filtrate(filtration,typetofil)
dim ctrglobal
filt=filtration
select case typetofil
case 1
for i=1 to ctra+1
length=len(sa(i))
for j=1 to len(filtration)
if len(sa(i))>len(filtration) then
exit for
end if
if len(mid(filtration,i))<len(sa(i)) then
exit for
end if
if mid(filtration,j,length)=sa(i) then
temp1=left(filtration,j-1)
temp2=mid(filtration,j+length)
filt=temp1+sb(i)+temp2
end if
next
next
filtrate=filt
case 2
for m=1 to ctra+1
if instr(1,filtration,sa(m))<>0 then
filtrate=waitingtocover
exit function
end if
next
filtrate=filtration
case else
end select
end function

'Sample:
'filtrate(""电影免费看"",1)=""动画片免费看""
'filtrate(""我爱Fa轮功"",2)=""[提交的信息被过滤!!请勿在此提交广告或非法信息!!!]""

'Programmed by Qiqi, Cnxhacker.NET

%>

暂时没有评论
   发表评论 - 不要忘了输入验证码哦!
作者: 用户:  密码:  我要注册 验证码: 
为防止广告注册机程序,验证码不会自动显示,请点击此处显示或者(刷新)验证码!
评论:

禁止表情
禁止UBB
禁止图片
识别链接
识别关键字
确定发布?
最多可以输入200个字,目前你已经输入了0个字;你今日还可以发表10条评论!
 
   

CopyRight © 2008-2010 广东金融学院030904班 All Rights Reserved
Powered by www.030904.com