函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: hPtSY'_@_
tK)E*!
字符类型的 wWm1G)
strUsername = CheckInput(Request(“username“),“s“) S N_!o2F2
数字类型的 oeKI9p13\
ID = CheckInput(Request(“id“),“i“) UP=0>jjbn:
w^N xR,
下面是函数 *=i|E7Irg
nW2fB8yq
+
5 E6|
Function CheckInput(str,strType) RE/'E?G
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 ,^,KWi9
参数意义: str ---- 要过滤的参数 $/;:Xb=q
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i <;\T
e4g[
Dim strTmp FEgM4m.(G<
strTmp = xsS/)R?
If strType =s Then O--
"\4
strTmp = Replace(Trim(str),,) O57n<J'6
ElseIf strType=i Then e$>.x<
Eq
If isNumeric(str)=False Then str=0 g2L^cP>2
strTmp = str HHu|X`tc
Else 9ui_/[K
strTmp = str :9H=D^J
End If /h'V1zL#
CheckInput = strTmp Q#NXJvI
End Function K(RG:e~R0i
9?<WRM3a>
&UH .e
vfAR^*7e
转自: ASP教程采集