函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: |1zoT|}q
_ji"##K
字符类型的 Y]aVa2!Wb
strUsername = CheckInput(Request(“username“),“s“) 37DyDzW)'
数字类型的 5A,@$yp+
ID = CheckInput(Request(“id“),“i“) W3s>+yU
7*8R:X+^r
下面是函数 m$ZPQ0X
@UCGsw
gwDQ@
Function CheckInput(str,strType) TT3GFP
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 *2ZX*w37
参数意义: str ---- 要过滤的参数 w yP|#Z\
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i rmS.$h@7 m
Dim strTmp n`Pwo&
strTmp = HV-c
DL
If strType =s Then ;0ap#6 T
strTmp = Replace(Trim(str),,) )mw#MTv<[
ElseIf strType=i Then +:3K?G-
If isNumeric(str)=False Then str=0 t{#Btd
strTmp = str S"ZH5O(
Else JsohhkJNGi
strTmp = str cRPW
End If ;/w-7O:
CheckInput = strTmp G.Z:00x
End Function _ KBN
j^#4!Ue
@: u>
YvD+Lk' hm
转自: ASP教程采集