函数很简单, 主要是针对字符串和数字两种类型的传入数据分别进行了处理,具体用法: 7]%il[
0*?XQV@
字符类型的 *fSM' q;
strUsername = CheckInput(Request(“username“),“s“) %j">&U.[
数字类型的 p2vBj. *J
ID = CheckInput(Request(“id“),“i“) )6&\WNL-x
pT@!O}'$
下面是函数 \&5@ yh
LG#w/).^
P|4E1O
Function CheckInput(str,strType) ]$*{<
函数功能:过滤字符参数中的单引号,对于数字参数进行判断,如果不是数值类型,则赋值0 1H=wl=K
参数意义: str ---- 要过滤的参数 e@=[+iJc
strType ---- 参数类型,分为字符型和数字型,字符型为s,数字型为i 7omGg~!k(
Dim strTmp //lZmyP?
strTmp = Iv72;ZCh?6
If strType =s Then ]7kGHIJ|
strTmp = Replace(Trim(str),,) ,6O9#1A&i
ElseIf strType=i Then k6'#
If isNumeric(str)=False Then str=0 1fW4=pF-K
strTmp = str "g%:#'5
Else |OZ>/l {
strTmp = str id+m[']+
End If #0g#W
CheckInput = strTmp 'c0'P%[5A
End Function ]HV~xD7\
eCIRt/ uA
npcBpGL{
`u~
转自: ASP教程采集