函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: [.a;L">
uWTN2jr
字符类型的 {|XQO'Wg
strUsername = CheckInput(Request(“username“),“s“) dnwdFsf
数字类型的 `dO}L
ID = CheckInput(Request(“id“),“i“) ?ql2wWsQO
:c=v}
下面是函数 9Eg&CZ,9$D
/1[gn8V691
xZyeX34{M;
Function CheckInput(str,strType) x{Sd
P$
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 gfm;xT/y
参数意义: str ---- 要过滤的参数 /VO^5Dnb
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i Ft)
lp>3gv
Dim strTmp Xem5@
(u
strTmp = wyzOcx>M
If strType =s Then XVF^,Yf
strTmp = Replace(Trim(str),,) J\{$ot
ElseIf strType=i Then H_Os4}
If isNumeric(str)=False Then str=0 sP y2/7Wqd
strTmp = str zKxvN3!
Else \?&Au
strTmp = str V&[eSVY?
End If U CRAw3=
CheckInput = strTmp .=XD)>$
End Function {a@>6)
%2D17*eK
l E^*t`+
xnbsg!`;7W
转自: ASP教程采集