函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: 2Z7r ZjXW
{J]x81}*;
字符类型的 6Jd.Eg ~A7
strUsername = CheckInput(Request(“username“),“s“) N.?)s.D(
数字类型的 \pVWYx
ID = CheckInput(Request(“id“),“i“) @"L*!
o|nN0z)b4
下面是函数 9_lWB6
:7)lg iM2
b9 TsuY
Function CheckInput(str,strType) O^sOv!!RH/
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 xMHu:,ND
参数意义: str ---- 要过滤的参数 XG01g3
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i ~JG\b?s
Dim strTmp >%c7|\q[ R
strTmp = >M^4p
If strType =s Then #pr{tL
strTmp = Replace(Trim(str),,) WbGN
5?9Q
ElseIf strType=i Then 1[ 40\ sM
If isNumeric(str)=False Then str=0 PEPf=sm
strTmp = str v-!^a_3Ui
Else ;lc/FV[/
strTmp = str Fm4)|5
End If UpS7>c7s
CheckInput = strTmp ^(~%'f
End Function M&^Iun
1XJLGMW,
pvY BhTz0
67A g.f6-
转自: ASP教程采集