函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: ]^?V8*zL]
AcxC$uh
字符类型的 e6igx
strUsername = CheckInput(Request(“username“),“s“) y|[YEY U)
数字类型的 %[7<GcWl
ID = CheckInput(Request(“id“),“i“) WbDD9ZS
</7_T<He.
下面是函数 ^ G@o} Z
ZsepTtY
f1}b;JJTsv
Function CheckInput(str,strType) 8n Oent0a
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 {\zB'SNq
参数意义: str ---- 要过滤的参数 Jb"0P`senY
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i M8iI e:{ c
Dim strTmp Aq"<#:
strTmp = 30nR2mB
Kt
If strType =s Then a gM I$
strTmp = Replace(Trim(str),,) ;,F:.<P
ElseIf strType=i Then CXfPC[o
If isNumeric(str)=False Then str=0 3QO*1P@q
strTmp = str -p2 =?a
Else f+j-M|A
strTmp = str hp)k[|u;
End If 3# r`e
CheckInput = strTmp R=u!RcvR
End Function +
c"$-Jr
}_"<2|~_
lVc':,z
_4h[q4Z
转自: ASP教程采集