asp 過濾非法字符函數(shù)
更新時間:2009年02月21日 03:45:57 作者:
過濾非法字符
<%
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
Response.Write cutbadchar("中國不阿斗發(fā)射點發(fā)明")
%>
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
Response.Write cutbadchar("中國不阿斗發(fā)射點發(fā)明")
%>
相關(guān)文章
可用的ASP無重復(fù)數(shù)字隨機函數(shù), 數(shù)組實現(xiàn), 并應(yīng)用于隨機顯示記錄集
可用的ASP無重復(fù)數(shù)字隨機函數(shù), 數(shù)組實現(xiàn), 并應(yīng)用于隨機顯示記錄集...2007-03-03
msxml3.dll 錯誤 800c0019 系統(tǒng)錯誤:-2146697191解決方法
今天發(fā)現(xiàn)一個asp后臺使用了XMLHTTP組件的頁面無法無法生成靜態(tài)頁面了,運行時提示msxml3.dll 錯誤 800c0019 系統(tǒng)錯誤:-2146697191,經(jīng)過搜索如下方法解決了問題2020-11-11
asp 實現(xiàn)檢測字符串是否為純字母和數(shù)字組合的函數(shù)
asp 實現(xiàn)檢測字符串是否為純字母和數(shù)字組合的函數(shù)...2007-08-08
asp利用Split函數(shù)進行多關(guān)鍵字檢索
怎樣提取數(shù)據(jù)庫用|隔開的字!2009-09-09

