函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: xP'IyABx
)?pin|_x
字符类型的 1l\O9D +$
strUsername = CheckInput(Request(“username“),“s“) |.:O$/ Tt[
数字类型的 !{s$V2_
ID = CheckInput(Request(“id“),“i“) 5"y
p|Yl
>
Q@*o
下面是函数 t2OXm
8Mg4y1)RU
^V_acAuS^
Function CheckInput(str,strType) @D"#B@j
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 D5T\X-+]O
参数意义: str ---- 要过滤的参数 R^](X*
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i yixW>W}
Dim strTmp :M|c,SQK
strTmp = N,'JQch},8
If strType =s Then tb/u@}")
strTmp = Replace(Trim(str),,) j#&sZ$HQ4
ElseIf strType=i Then )\^o<x2S
If isNumeric(str)=False Then str=0 4PD"[a="
strTmp = str r=L9x/r
Else ~JLqx/[|s
strTmp = str bq[Q
End If (GPJ=r
CheckInput = strTmp &O0+\A9tP
End Function a4`@z:l
K!I]/0L
\U !<-
YXIDqTA+
转自: ASP教程采集