注册 登录
编程论坛 ASP技术论坛

[求助]这个函数的作用是什么?

alon999 发布于 2007-09-18 14:57, 333 次点击

Function SafeRequest(ParaName,ParaType)
Dim ParaValue
ParaValue=Request(ParaName)
If ParaType=1 then
If not isNumeric(ParaValue) then
Response.write "<center>参数" & ParaName & "必须为数字型,请正确操作!</center>"
Response.end
End if
Else
ParaValue=replace(ParaValue,"'","''")
End if
SafeRequest=ParaValue
End function


1 回复
#2
yms1232007-09-18 15:17
Function SafeRequest(ParaName,ParaType)
Dim ParaValue
ParaValue=Request(ParaName)'获得Request参数
If ParaType=1 then'如果ParaType为1检查是否为数字型
If not isNumeric(ParaValue) then'检查Request是否为数字型
Response.write "<center>参数" & ParaName & "必须为数字型,请正确操作!</center>"
Response.end
End if
Else
ParaValue=replace(ParaValue,"'","''")'文本型参数把单引号替换为双引号
End if
SafeRequest=ParaValue'将函数处理结果返回
End function
1