函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: d4/ZOj+%
Lq:Z='Kc
字符类型的 qbjRw!2?w
strUsername = CheckInput(Request(“username“),“s“) o4xZaF4+
数字类型的 V<b"jCXI
ID = CheckInput(Request(“id“),“i“) >5\rU[H>
j:g/[_0s
下面是函数 "Mth<%i
'j|;M
LaRY#9
Function CheckInput(str,strType) 8D-g%Aj-
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 =73wngw
参数意义: str ---- 要过滤的参数 uXXwMc<p
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i |,o!O39}>
Dim strTmp c}QjKJ-c
strTmp = Vx'_fb?wap
If strType =s Then C+_ NG
strTmp = Replace(Trim(str),,) _("{fJ,A
ElseIf strType=i Then o`G@Je_}x
If isNumeric(str)=False Then str=0 *x$\5;A
strTmp = str H'+P7*k#M
Else !I@"+oY<
strTmp = str YQ&Xd/z-
End If fU,sn5zZ
CheckInput = strTmp l78zS'
End Function bx1'
o}<}zTU
S>nM&758
-YD6
转自: ASP教程采集