函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: Wvf>5g)?
tfGs|x
字符类型的 j'z#V_S
strUsername = CheckInput(Request(“username“),“s“) W_`]7RO8
数字类型的 ,%*UF6B
M
ID = CheckInput(Request(“id“),“i“) E5n7
<
Lc{arhN
下面是函数 @"MYq#2c$
M/=36{,w-
,r w4Lo
Function CheckInput(str,strType) /B@{w-N
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 .cHgYHa
参数意义: str ---- 要过滤的参数 k
i<X ^^
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i S@HC$
Dim strTmp :}zyd;Rc
strTmp = |NZi2Bu
If strType =s Then v"o"W[
strTmp = Replace(Trim(str),,) \mc0fY
ElseIf strType=i Then sX%n` L
If isNumeric(str)=False Then str=0 ~{/M_
=
strTmp = str Bdw33z*m
Else PlzM`g$A
strTmp = str ^[xcfTN
End If d^aVP
CheckInput = strTmp P[
:_"4U
End Function c a_mift
"CJ~BJI%
_Hv+2E[4Z
PR.3EL
转自: ASP教程采集