函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: T` h%=u|D
5z,q~CU
字符类型的 c-(RjQ~M5
strUsername = CheckInput(Request(“username“),“s“) i/+^C($'f
数字类型的 tjwf;g}$
ID = CheckInput(Request(“id“),“i“) l`zhKj
C/Tk`C&
下面是函数 /y{:N
LYECX
O}zHkcL
Function CheckInput(str,strType) PiM(QR
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0
~deS*
参数意义: str ---- 要过滤的参数 UX63BA
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i v77UE"4|c
Dim strTmp Q4-d|
strTmp = 9!n95
If strType =s Then @y7KP$t
strTmp = Replace(Trim(str),,) >W] Wc4\
ElseIf strType=i Then y,`n9[$K\
If isNumeric(str)=False Then str=0 Z,2?TT|p
strTmp = str Nuot[1kS
Else -%MXt
strTmp = str \99'#]\_/E
End If !AE;s}v)0{
CheckInput = strTmp 8%m\J:eR
End Function S?JCi=
/kG?I_z
w/o^OjwQ
qfl!>
转自: ASP教程采集