㈠ 几种过滤URL和FORM中非法字符的方法
ASP过滤URL和FORM中非法字符第一种:<%'检查URL输入限制非法字符url=LCase(request.querystring())ip=request.ServerVariables( REMOTE_ADDR)pos1=instr(url,%)pos2=instr(url,')pos3=instr(url,;)pos4=instr(url,where)pos5=instr(url,select)pos6=instr(url,chr)pos7=instr(url,/)pos8=Instr(url,and)ifpos1<0orpos2<0orpos3<0orpos4<0orpos5<0orpos6<0orpos7<0orpos8<0thenresponse.Write 你尝试使用危险字符,系统已经对此做了记录如下您的IP:&ip&操作时间:&date()& response.End()endif'检查表单输入,限制非法字符'使用request.QueryString来索引request的所有资料,作为SQL检查之用'如出现非法字符则自动停止输出fori_request=1torequest.form.Countifinstr(request.form(i_request),')<0orinstr(request.form(i_request),;)<0thenResponse.Write <scriptlanguage='javascript'history.back();alert('你尝试使用危险字符,系统已经对此做了记录如下您的IP:&ip&操作时间:&date()& ');</script response.End()endifnext%第二种:<%OnErrorResumeNextdimsql_injdata,sql_inj,sql_get,sql_data SQL_injdata='|oxSQL_inj=split(SQL_Injdata,|)'定义过滤字符,可以自己添加,以|分隔''|;|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare'对post方式过滤IfRequest.Form<ThenForEachSql_PostInRequest.FormForSQL_Data=0ToUbound(SQL_inj)ifinstr(Request.Form(Sql_Post),Sql_Inj(Sql_DATA))0ThenResponse.redirectss'出错时转向页面 Response.endendifnextnextendif'对GET方式过滤IfRequest.QueryString<ThenForEachSQL_GetInRequest.QueryStringForSQL_Data=0ToUbound(SQL_inj)ifinstr(Request.QueryString(SQL_Get),Sql_Inj(Sql_DATA))0ThenResponse.redirectss'出错时转向页面 Response.endendifnextNextEndIf%第三种:functioncheckstr(str)'过滤非法字符函数dimtempstrifstr=thenexitfunctiontempstr=replace(str, chr(34),)'tempstr=replace(tempstr, chr(39),)''tempstr=replace(tempstr, chr(60),)'<tempstr=replace(tempstr, chr(62),)'tempstr=replace(tempstr, chr(37),)'%tempstr=replace(tempstr, chr(38),)'&tempstr=replace(tempstr, chr(40),)'(tempstr=replace(tempstr, chr(41),)')tempstr=replace(tempstr, chr(59),)';tempstr=replace(tempstr, chr(43),)'+tempstr=replace(tempstr, chr(45),)'-tempstr=replace(tempstr, chr(91),)'[tempstr=replace(tempstr, chr(93),)']tempstr=replace(tempstr, chr(123),)'{tempstr=replace(tempstr, chr(125),)'}checkstr=tempstrendfunction第四种:'================================================'函数名:IsValidStr'作用:判断字符串中是否含有非法字符'参数:str----原字符串'返回值:False‚True-----布尔值'================================================PublicFunctionIsValidStr(ByValstr)IsValidStr=(str)ThenExitFunctionIfTrim(str)=‚iForbidStr= and|chr|:|=|%|&|$|#|@|+|-|*|/|/|<||;|‚|^|&Chr(32)&|&Chr(34)&|&Chr(39)&|&Chr(9)ForbidStr=Split(ForbidStr‚|)Fori=0ToUBound(ForbidStr)IfInStr(1‚str‚ForbidStr(i)‚1)0ThenIsValidStr==TrueEndFunctionASP.(Stringpara)//过滤非法字符{intflag=0;flag+=para.indexOf(')+1;flag+=para.indexOf(;)+1;flag+=para.indexOf(1=1)+1;flag+=para.indexOf(|)+1;flag+=para.indexOf(<)+1;flag+=para.indexOf()+1;if(flag!=0){System. out 提交了非法字符!!!);returnfalse;}returntrue;}
㈡ 网站中有哪些违禁词工具是只要输入网站就能够查询全站的
牛商 网有开发一款是查网站违禁词的工具,叫旋涡营销。
㈢ 网络非法字 有那些
妈逼
牛逼
五月天
打了这些词可能显示不出来。。。
㈣ 网站要过滤哪些不良词语
这个很多的,(你反着念我打有故意错别字)如:登了本、功伦花、药麻、支枪,片A等。)具体要看该站的限制,你若有网站为了便于管理可向网上监管索要相关词汇。为了社会安宁,上面也是不得已而为止。
㈤ 网站常设的违禁词语有哪些
短信群发 鹰击长空 狮搏群雄 象形无敌
㈥ 网站都会把敏感词汇屏蔽掉,举例说明一下
你这个问题问的就有点问题。
你说的是你自己的这个网站还是别人的网站里发布信息会把你的敏感词给屏蔽掉。
如果你是在别的网站发布信息,敏感词自动被屏蔽了,这个很正常,因为现在网站内容方面管控的非常严格,只要涉及到敏感的,基本上就自动过滤的,也没有什么好的解决方法。
只能你自己写好稿子之后,再去看一下内容,文字有没有敏感的信息,有的就直接替换成其他文字即可。