函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: )WFr</z5bA
Wn}'bqp
字符类型的 wUM0M?_p[
strUsername = CheckInput(Request(“username“),“s“) ,"0:3+(8;
数字类型的 S5EK~#-L[
ID = CheckInput(Request(“id“),“i“) d<x7{?~.DK
K~EmD9
下面是函数 v(%*b,^
/_ajaz%
A+?`?pOm&
Function CheckInput(str,strType) Uoix
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 2 8u_!f[
参数意义: str ---- 要过滤的参数 j*m%*_kO
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i 9(<@O%YU
Dim strTmp Yu`~U,m
strTmp = r:TH]hs12+
If strType =s Then Mrb)
strTmp = Replace(Trim(str),,) W=4FFl[
ElseIf strType=i Then m~ee/&T
If isNumeric(str)=False Then str=0 1yY0dOoLG)
strTmp = str S`Rs82>
Else [=`q>|;pOv
strTmp = str hK|Ul]qI
End If E&:,oG2M
CheckInput = strTmp I1&aM}y{G
End Function \z}
Ic%Tp
+8ZF"{y
q-d:TMkc
~flV`wy$$1
转自: ASP教程采集