函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: AEaN7[PQx|
2C}Yvfm4
字符类型的 n[gE[kw
strUsername = CheckInput(Request(“username“),“s“) d{Jk:@.1
数字类型的 gSw4\ R
ID = CheckInput(Request(“id“),“i“) Ex
z B{"
"^6Fh"]
下面是函数 ZLxa|R7
.MG83Si
g hmn3
Function CheckInput(str,strType) -e}(\
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 yc~<h/}#
参数意义: str ---- 要过滤的参数 x 55W"q7
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i ^~-YS-.J#,
Dim strTmp _~;%zFX
strTmp = vm[*+&\2
If strType =s Then \u{4=-C.
strTmp = Replace(Trim(str),,) u>.a; BO
ElseIf strType=i Then G 3,v'D5
If isNumeric(str)=False Then str=0 #"KC29!Yj
strTmp = str !hZ:
\&V
Else &nXE?-J
strTmp = str ObEz 0Rj
End If z2t+1In,
CheckInput = strTmp hXth\e\[{`
End Function jzJTV4&zjs
mN}szW,
YLQ0UeDN'
ws5Ue4g|
转自: ASP教程采集