久久久精品2019免费观看_亚洲国产精品成人久久久_69国产成人综合久久精品91_国产精品久久精品视

ASP特殊字符過濾的函數(shù)

  核心提示:%str='dshofghe98awyt9'if ChkInvaildWord(str) thenresponse.write '你的輸入含有非法字符'response.endend ifFunction ChkInvaildWord(Words)Const InvaildWords='select…
itE-SPACE: normal; BACKGROUND: url(http://yx095.info/static/image/commoncodebg.gif) rgb(247,247,247) repeat-y 0px 0px; LETTER-SPACING: normal; COLOR: rgb(68,68,68); BORDER-TOP: rgb(204,204,204) 1px solid; BORDER-RIGHT: rgb(204,204,204) 1px solid; WORD-SPACING: 0px; PADDING-TOP: 10px; -webkit-text-stroke-width: 0px" class=blockcode>

<%

str="dshofghe98awyt9"

if ChkInvaildWord(str) then

response.write "你的輸入含有非法字符"

response.end

end if

Function ChkInvaildWord(Words)

Const InvaildWords="select|update|delete|insert|@|–|," ''需要過濾得字符以“|”隔開,最后結(jié)束的字符必須是|



ChkInvaildWord=True

InvaildWord=Split(InvaildWords,"|")

inWords=LCase(Trim(Words))



For i=LBound(InvaildWord) To UBound(InvaildWord)

If Instr(inWords,InvaildWord(i))>0 Then

ChkInvaildWord=True

Exit Function

End If

Next

ChkInvaildWord=False

End Function

%>

 

例如 你現(xiàn)在接受了一個(gè)STR的值

那么就直接 ChkInvaildWord(STR)

如果STR中間有特殊字符 那么你就得到了FALSE

如果沒有 那么你就得到TRUE

一般都都會(huì)在前面加上IF判斷。。

未經(jīng)允許不得轉(zhuǎn)載:445IT之家 » ASP特殊字符過濾的函數(shù)

贊 (0) 打賞

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

微信掃一掃打賞