ASP程序 购物车数量不能修改 10
<!--#includefile="conn.asp"--><%actionid=request("actionid")ifactionid=""thenresponse...
<!--#include file="conn.asp"-->
<%
actionid=request("actionid")
if actionid="" then
response.write "<script language=javascript>alert('对不起,您没有选择商品!');window.close();</script>"
response.End
end if
for i=1 to request.form("actionid").count
if request.form("bookcount")(i)<=0 then
bookcount=1
else
bookcount=request.form("bookcount")(i)
end if
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from products where bookid="&request.form("bookid")(i),conn,1,1
if request.cookies("Cnhww")("reglx")=2 then
danjia=rs_s("vipjia")
else
danjia=rs_s("huiyuanjia")
end if
kucun=rs_s("kucun")
bookname=rs_s("bookname")
rs_s.close
set rs_s=nothing
if kucun<=cint(bookcount) then
response.write "<script language=javascript>alert('你选购的商品“"&bookname&"”库存不足,不能修改数量,请选购更换其它商品!');window.location.href='buy.asp?action=show';</script>"
response.end
end if
conn.execute("update orders set bookcount="&bookcount&",zonger="&danjia*bookcount&" where actionid="&request.form("actionid")(i))
next
response.Redirect "buy.asp?action=show"
%>
----------------------------------------------
不管什么样改 总是弹出 展开
<%
actionid=request("actionid")
if actionid="" then
response.write "<script language=javascript>alert('对不起,您没有选择商品!');window.close();</script>"
response.End
end if
for i=1 to request.form("actionid").count
if request.form("bookcount")(i)<=0 then
bookcount=1
else
bookcount=request.form("bookcount")(i)
end if
set rs_s=server.CreateObject("adodb.recordset")
rs_s.open "select * from products where bookid="&request.form("bookid")(i),conn,1,1
if request.cookies("Cnhww")("reglx")=2 then
danjia=rs_s("vipjia")
else
danjia=rs_s("huiyuanjia")
end if
kucun=rs_s("kucun")
bookname=rs_s("bookname")
rs_s.close
set rs_s=nothing
if kucun<=cint(bookcount) then
response.write "<script language=javascript>alert('你选购的商品“"&bookname&"”库存不足,不能修改数量,请选购更换其它商品!');window.location.href='buy.asp?action=show';</script>"
response.end
end if
conn.execute("update orders set bookcount="&bookcount&",zonger="&danjia*bookcount&" where actionid="&request.form("actionid")(i))
next
response.Redirect "buy.asp?action=show"
%>
----------------------------------------------
不管什么样改 总是弹出 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询