函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: :bgi*pR{
q|%(47}z
字符类型的 ^\<1Y''
strUsername = CheckInput(Request(“username“),“s“) xe6 2gaT
数字类型的 n300kpv
ID = CheckInput(Request(“id“),“i“) nNFZ77lg
tXTa>Q
下面是函数 WVf>>E^1
~l@SGHx
AjZ@hid
Function CheckInput(str,strType) G =+ sW
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 i=<N4Vx
参数意义: str ---- 要过滤的参数 b&Sk./
J6
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i jibrSz
Dim strTmp ^8nK x<&5
strTmp = ,wlh0;,
If strType =s Then q*<Df=+B
strTmp = Replace(Trim(str),,) t$Z#zxX
ElseIf strType=i Then 1qb 3.
If isNumeric(str)=False Then str=0 F3b[L^Km]
strTmp = str 0Kjm:x9T
Else g<Sa{<0
strTmp = str .;n<k
End If T%xB|^lf
CheckInput = strTmp |:tFQ.Z'2
End Function h2Z Gh
08S|$_
f[!QR
@&]j[if(s
转自: ASP教程采集