函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: <RsKV$Je
I
,#;ahwU~s
字符类型的 Elk$9 <<
strUsername = CheckInput(Request(“username“),“s“) b!P;xLcb
数字类型的 '^Np<
ID = CheckInput(Request(“id“),“i“) VQ3&
Lcb59Cs6e
下面是函数 HliY
g*AqFY7|
DNO%J^
Function CheckInput(str,strType) 6FFv+{2^@
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 2g==98>cg
参数意义: str ---- 要过滤的参数 9'aR-tFun;
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i 'Em($A(
Dim strTmp nu-wQr
strTmp = qz2d'OhmtH
If strType =s Then !]T|=yw
strTmp = Replace(Trim(str),,) Jev.o]|_,
ElseIf strType=i Then ~WLsqP5Y~a
If isNumeric(str)=False Then str=0 jzp%.4/j
strTmp = str 7si.]
Else ^i7a2<
z
strTmp = str 3=I Q
End If Vi-@z;k
CheckInput = strTmp w$HC!
End Function (dZ&Af
T^SOq:m&
PrxXL/6
mL+ps x+
转自: ASP教程采集