函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: Y(]&j`%
)ccdfSe
字符类型的 4%I(Z'*Cx
strUsername = CheckInput(Request(“username“),“s“) E0 Vl}b
数字类型的 7^J-5lY3S
ID = CheckInput(Request(“id“),“i“) J
dDP
!Ax 7k;T
下面是函数 +0O{"XM
?_F,HhQ
0F<O \
Function CheckInput(str,strType) w^&TG3m1~
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 4{\h53j$
参数意义: str ---- 要过滤的参数 ?)cNe:KY
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i $[Fh|%\
Dim strTmp ntSPHK|'
strTmp = sS $- PX
C
If strType =s Then { [4Y(l1
strTmp = Replace(Trim(str),,) ;6} *0V_!k
ElseIf strType=i Then |j
i}LWcD
If isNumeric(str)=False Then str=0 G'z&U?Ng
strTmp = str ?6
"F.\O@
Else %Iv0<oU
strTmp = str URW'*\Xjb
End If I$neE"wW
CheckInput = strTmp oWpy^=D_
End Function 9zkR)C
eD, 7gC-
`
m`Sl[6
5}R/C{fs
转自: ASP教程采集