解析如何过滤不文明字符

ASP教程 2025-08-30

推荐:ASP调用纯真IP库实例
% ' ============================================ ' 返回IP信息 Disp_IPAddressData(IP,0) ' ============================================ Function Look_Ip(IP) Dim Wry, IPType, QQWryVersion, IpCounter ' 设置类对象 Set Wry = New TQQWry ' 开始搜

<%

Function badchar(str)

badstr=不文明字符列表,用|分开(因发表时不能含有那些字符,所以不能贴出。)

badword=split(badstr,|)

For i=0 to Ubound(badword)

If instr(str,badword(i)) > 0 then

badchar=True

Exit For

Else

badchar=False

End If

Next

End Function

Function cutbadchar(str)

badstr=不文明字符列表,用|分开(因发表时不能含有那些字符,所以不能贴出。)

badword=split(badstr,|)

For i=0 to Ubound(badword)

If instr(str,badword(i)) > 0 then

str=Replace(str,badword(i),×××)

End If

Next

cutbadchar=str

End Function

%>

分享:ASP实例:ASP实现空间的最近访客
由于工作关系,在做一个用户空间。要用到空间的最近访客,见ASP代码: % username=request.QueryString(username) '地栏中的username,就是自己的用户名了 if trim(request.Cookies(user_name)) Then '首页要判断该访问是否登陆,只有登陆的访问才能记