函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: 9W-1P}e,
/lhk}
y^
字符类型的 Z~[eG"6zI
strUsername = CheckInput(Request(“username“),“s“) Spn)M79
数字类型的 sHPj_d#
ID = CheckInput(Request(“id“),“i“) P@%L.y
B
(*,R21<%
下面是函数 4N=
gl(
?{xD{f$
&|' NDcp
Function CheckInput(str,strType) `b%^_@Fb
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 4,?beA
参数意义: str ---- 要过滤的参数 keStK8
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i LI^D\
Dim strTmp j`K0D65
strTmp = ?.n1t@sG&
If strType =s Then B\qy:nr j
strTmp = Replace(Trim(str),,) +q+JOS]L
ElseIf strType=i Then ltMcEv-d0
If isNumeric(str)=False Then str=0 jhBfy|Ftu
strTmp = str 3,#v0 #
Else zMM~4?4
strTmp = str ;0NJX)GL
End If K@/dQV%Z
CheckInput = strTmp e@S\7Ks
End Function M
9NT%7Il
1=ZQRJW0B
Qstd;qE~
C~'.3Q6
转自: ASP教程采集