㈠ 幾種過濾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等。)具體要看該站的限制,你若有網站為了便於管理可向網上監管索要相關詞彙。為了社會安寧,上面也是不得已而為止。
㈤ 網站常設的違禁詞語有哪些
簡訊群發 鷹擊長空 獅搏群雄 象形無敵
㈥ 網站都會把敏感詞彙屏蔽掉,舉例說明一下
你這個問題問的就有點問題。
你說的是你自己的這個網站還是別人的網站里發布信息會把你的敏感詞給屏蔽掉。
如果你是在別的網站發布信息,敏感詞自動被屏蔽了,這個很正常,因為現在網站內容方面管控的非常嚴格,只要涉及到敏感的,基本上就自動過濾的,也沒有什麼好的解決方法。
只能你自己寫好稿子之後,再去看一下內容,文字有沒有敏感的信息,有的就直接替換成其他文字即可。