函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: Yn'XSV|g
}u5 Mexs
字符类型的 h%E25in
strUsername = CheckInput(Request(“username“),“s“) X`.4byqdK
数字类型的 A:cc @ku
ID = CheckInput(Request(“id“),“i“) 3 ^{U:"N0
$_S^Aw?
下面是函数 )fA9,yNJ3
kD >|e<}\
UDt.w82
Function CheckInput(str,strType) tCI8\~
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 <Zl0$~B:5
参数意义: str ---- 要过滤的参数 2a (w7/W:
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i P`-(08t
Dim strTmp :*/<eT_
strTmp = 8W[QV
If strType =s Then dn:g_!]p
strTmp = Replace(Trim(str),,) e&<#8;2X
ElseIf strType=i Then wI#rAx7f-
If isNumeric(str)=False Then str=0 WxWgY}`
strTmp = str _@F4s
Else ["Z]K'?P
strTmp = str D<5gdIw
End If _&19OD%
CheckInput = strTmp L)y }
End Function SKD!V6S
N95"dNZE
D7sw;{ns
G?<L{J2"Q
转自: ASP教程采集