函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: 7Pc0|Z/
#89h}mp'
字符类型的 IFX|"3[$
strUsername = CheckInput(Request(“username“),“s“) ] _/d
数字类型的 YW}1iT/H
ID = CheckInput(Request(“id“),“i“) Iy}r'#N
$DfaW3bJ
下面是函数 J\%<.S>
V+dfV`*k
Ur626}
Function CheckInput(str,strType) 4R U1tWQ%
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 8O]U&A@
参数意义: str ---- 要过滤的参数 4nhe *ip
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i #&1Y!kbdd
Dim strTmp LaE;{ jY
strTmp = vl@t4\@3
If strType =s Then F$K-Q;r]<
strTmp = Replace(Trim(str),,) {1GW,T!#
ElseIf strType=i Then %;0w2W
If isNumeric(str)=False Then str=0 fxDY:l
strTmp = str 4Pljyq:
Else <(JsB'TK
strTmp = str n/"T7Y\2
End If ;UgRm#
CheckInput = strTmp L-d8bA
End Function c=2e?
*x|
<\_+
L!L/QG|wdf
OvPy+I
转自: ASP教程采集