函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: 2~BId&]
KN"V(<!)~
字符类型的 ;}=[( eqA
strUsername = CheckInput(Request(“username“),“s“) k2S6 SB
数字类型的 R9B !F{! 5
ID = CheckInput(Request(“id“),“i“) |K%nVcR=
U]h5Q.<SG
下面是函数 {}TR'Y4
;2=H7dq
xo46L\
Function CheckInput(str,strType) o]vU(j_Ju
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 !SFF 79$c
参数意义: str ---- 要过滤的参数 Zg@NMT
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i +R_w- NI
Dim strTmp l'2a?1/q
strTmp = [|\JIr=of5
If strType =s Then @pKQ}?
strTmp = Replace(Trim(str),,) #sq$i
ElseIf strType=i Then oKJj?%dHK9
If isNumeric(str)=False Then str=0 K8l|qe
strTmp = str Z ?{;|Z5
Else 9OC!\'
8
strTmp = str ci@U
a}T
End If 54 Baz
CheckInput = strTmp lF\oEMd*
End Function TuBl9 p'6
JRm:hf'
x_JCH7-
L.[ H
转自: ASP教程采集