函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: LUuZ9$t0J"
+)j$|x~(A
字符类型的 Rn{iaM2Y<
strUsername = CheckInput(Request(“username“),“s“) `|,`QqDQ
数字类型的 UG2nX3?
ID = CheckInput(Request(“id“),“i“) NXNY"r7~
#tZ4N7
下面是函数 c:-!'l$ !
Sg6"WV{<
h&`e) a>+
Function CheckInput(str,strType) iTag+G4*
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 wtc!>
参数意义: str ---- 要过滤的参数 u[L`-zI
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i t*>R`,j
Dim strTmp `0P$#5?
strTmp = SILQ
If strType =s Then HuwU0:*
strTmp = Replace(Trim(str),,) O)ME"@r@:
ElseIf strType=i Then ^j".
If isNumeric(str)=False Then str=0
KnsT\>[K
strTmp = str VJdIHsI
Else 7PANtCFb&
strTmp = str %!du,2
End If MxY/`9>E|+
CheckInput = strTmp e XfZ5(na
End Function -PS#Z0>
\
C+(~9@|
gF$V$cU
WAn~+=Ax
转自: ASP教程采集