函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: AkW,Fp1e
]yKwH 9sl
字符类型的 wp:$Tq a$
strUsername = CheckInput(Request(“username“),“s“) 8TYh&n=r
数字类型的 KeyKLkg>
ID = CheckInput(Request(“id“),“i“) pJg:afCg
`_vPElQXZ#
下面是函数 Vc'p+e|(
}|h-=T '
m:Rx<E
E
Function CheckInput(str,strType) 7eq.UyUxs
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 RPa]VL1W
参数意义: str ---- 要过滤的参数 M}jl\{
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i _$*-?*V&
Dim strTmp 'tTlBf7#
strTmp = cV:Q(|QC
If strType =s Then +PYR
strTmp = Replace(Trim(str),,) T\wOGaCW
ElseIf strType=i Then x75;-q
If isNumeric(str)=False Then str=0 {$ N\@q@v~
strTmp = str <=uO*s>%
Else ruqE]Hx9(
strTmp = str e~QLzZ3
End If j 1'H|4
CheckInput = strTmp HV`u#hZ7C
End Function % /zHL?RqJ
G%gdI3h1Z
;\"Nekd|
@uC-dXA"
转自: ASP教程采集