函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: ;Z8K3p
]v+\v re
字符类型的 VJPt/Dy{
strUsername = CheckInput(Request(“username“),“s“) Vdjca:`
数字类型的 f6z[k_lLN
ID = CheckInput(Request(“id“),“i“) O/FQ'o1F
KI#hII[Q.
下面是函数 .-o$IQsS
:_vf1>[
g{i(4DHm(
Function CheckInput(str,strType) [WB8X,
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 \Q
&Kd|
参数意义: str ---- 要过滤的参数 2AdV=n6Z
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i gXF.e.uU
Dim strTmp Iz ,C!c
strTmp = \oaO7w,:"
If strType =s Then yDHH05Yl
strTmp = Replace(Trim(str),,) p(
z.[
ElseIf strType=i Then [rf.P'p%
If isNumeric(str)=False Then str=0 {>syZZ,h
strTmp = str HtXzMSGo7
Else $cYh X^YG.
strTmp = str :V >Z|?[*H
End If Q.!D2RZc
CheckInput = strTmp f>Ij:b`Z2
End Function X)'uTf0
C7nLa@
aiz_6@Qfz*
;]'mx
转自: ASP教程采集