农村道路交通安全宣讲:ASP中有句不懂的,希望给予解答,谢谢

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 04:43:59
<title>我的购物车</title>
<%
dim id,username,action
action=FormatSQL(SafeRequest("action",0))
id=SafeRequest("id",1)
username=trim(request.cookies("timesshop")("username"))

select case action
case "del"
conn.execute "delete from orders where actionid="&FormatSQL(SafeRequest("actionid",1))
if SafeRequest("ll",1)=22 then
response.redirect "profile.asp?action=addtocart"
else
response.redirect "addto.asp?action=show"
end if
response.End

其中action=FormatSQL(SafeRequest("action",0))
id=SafeRequest("id",1)
是什么意思啊?还有
conn.execute "delete from orders where actionid="&FormatSQL(SafeRequest("actionid",1))
if SafeRequest("ll",1)=22 then
小弟新手 ,看不懂
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

Function FormatSQL(strChar)
if strChar="" then
FormatSQL=""
else
FormatSQL=replace(replace(replace(replace(replace(replace(replace(replace(strChar,"'","’"),"*","×"),"?","?"),"(","("),")",")"),"<","〈"),".","。"),";",";")
end if
End Function
这是那两个自定义函数,没明白什么意思啊

FormatSQL()
SafeRequest()
这两个函数在MSDN里没有找到,所以应该是两个自定义函数。
看看那段程序中是否有<!-- #include file=""-->语句或者程序后面是否定义了这两个函数。

SafeRequest应该是自定义函数,找找看,肯定有
function SafeRequest()
的定义

SafeRequest 肯定是他自己编的一个函数,你仔细找找。