函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: aJ_Eh(cF
3Qr!?=nf
字符类型的 \4X{\p<
strUsername = CheckInput(Request(“username“),“s“) !VTS
$nJ4
数字类型的 3n)iTSU3
ID = CheckInput(Request(“id“),“i“) RtM.}wv;
LZ]pyoi
下面是函数 )_.H #|r
I}A#*iD
K'/x9.'%
Function CheckInput(str,strType) a~EEow;A
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 SO<K#HfE$?
参数意义: str ---- 要过滤的参数 u"|nu!p`
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i gb#wrI
Dim strTmp bu5)~|?{t
strTmp = /VZU3p<~
If strType =s Then [B<{3*R_
strTmp = Replace(Trim(str),,) Dv{AZyqe
ElseIf strType=i Then %6:2cR
If isNumeric(str)=False Then str=0 Kg67cmj)f
strTmp = str #(4hX6?5AI
Else TI&J>/z;$
strTmp = str '(>N
gd[
End If (ajX;/
CheckInput = strTmp m_f^#:
End Function e]fC!>w(\
NtL?cWct
^O"`.2O1
2yc\A3ft#
转自: ASP教程采集