函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法:
|A#\5u
gq050Bl)
字符类型的 "8/BVW^bv
strUsername = CheckInput(Request(“username“),“s“) uuYeXI;
数字类型的 "6>+IF
ID = CheckInput(Request(“id“),“i“) #dkSAS
m=V69
a#
下面是函数 d bHxc@H
b ; U
|};-.}u^`h
Function CheckInput(str,strType) a'?V:3 ]
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 bCV_jR+
参数意义: str ---- 要过滤的参数 bOD]`*q
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i hZ-?-F?*@
Dim strTmp #^xj"}o@
strTmp = ~$m:j];
If strType =s Then l{hO"fzy
strTmp = Replace(Trim(str),,) ^IO\J{U{"x
ElseIf strType=i Then EC7)M}H
If isNumeric(str)=False Then str=0 }B&+KO)
strTmp = str D(#6H~QN%
Else VUzRA"DP|
strTmp = str K,dEa<p
End If G x{G}9
CheckInput = strTmp /]9(InM9/
End Function rtz ]PH
rbI 7
3'
t]8nRZ1
-?vVV@W-O^
转自: ASP教程采集