函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: #M~yt`R~
1 ?BLL;[a8
字符类型的 -r,v3n
strUsername = CheckInput(Request(“username“),“s“) [s$x"Ex
数字类型的 ?;oJ=.T
ID = CheckInput(Request(“id“),“i“) `xx.,;S
pnuo;r s
下面是函数 ~qZ6I)?
$e+4Kt
,
uD(C jHM>
Function CheckInput(str,strType) .nZKy't
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 0UJ6>Rj
参数意义: str ---- 要过滤的参数 yf&_l^!
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i f?:=@35
Dim strTmp /ckkqk"
strTmp = rGQD+ d
If strType =s Then >TglX t+
strTmp = Replace(Trim(str),,) Fm:Ys](
ElseIf strType=i Then @U!&XZ]h
If isNumeric(str)=False Then str=0 Qw5-/p=t
strTmp = str h[u@UGK%
Else WyOav6/*K^
strTmp = str 1n<4yfJ
End If 8o+:|V~X
CheckInput = strTmp hdWV vN
End Function K6-)l
isf
0\U*
a>l,H#w*vW
Tv1oy%dK
转自: ASP教程采集