函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: q]\:P.x!>
1Lc#m`Jln
字符类型的 6o!!=}'E[
strUsername = CheckInput(Request(“username“),“s“) p09HL%~R
数字类型的 3r<~Q7e
ID = CheckInput(Request(“id“),“i“) X@'uy<tI-
i/65v
下面是函数 A^nvp!_
t=(!\:[D
Hn7_FOC
Function CheckInput(str,strType) Mz9r5
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 ~xbe~$$Q@
参数意义: str ---- 要过滤的参数 TcyNIx
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i :iK(JE`
Dim strTmp Bgn&:T8<
strTmp = O%Scjm-^X
If strType =s Then y_'Ub{w
strTmp = Replace(Trim(str),,) j?A/#
ElseIf strType=i Then &D>G8
If isNumeric(str)=False Then str=0 Nu0C;B66
strTmp = str |Z|-q"Rf
Else |+"<wEKI
strTmp = str niiA7Ux
End If Z EXc%-M
CheckInput = strTmp -0d0t!
End Function _- [''(E
o906/5M
bH-ub2@qO
}HL]yDO
转自: ASP教程采集