函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: Sj(5xa[
qp##>c31X
字符类型的 7oWT6Qa5
strUsername = CheckInput(Request(“username“),“s“) <y`MUpf]
数字类型的 ,;D$d#\"
ID = CheckInput(Request(“id“),“i“) Acix`-<
C
srxi'Pe
下面是函数 NpPuh9e{
j-$F@p_2F
`>1XL 2
Function CheckInput(str,strType) \img
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 Ga$ J7R
参数意义: str ---- 要过滤的参数 NB^+Hcb$
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i ojva~mnFf
Dim strTmp +`RQ^9
strTmp = 3u,C I!
If strType =s Then _ J t
strTmp = Replace(Trim(str),,) 4it^-M
ElseIf strType=i Then Ea,L04K
If isNumeric(str)=False Then str=0 -xVp}RLT
strTmp = str -Z(='A
Else P$7i>(?(
strTmp = str )hy(0 D
End If w,)O*1't
CheckInput = strTmp VZ3{$0
+
End Function Y?'Krw `
tEam6xNf,
KkJrh@lk
93[&'
转自: ASP教程采集