?? shopcart_inc.asp
字號:
<!--#include file="conn.asp"-->
<%
if request.cookies("shopzhiwang")("username")="" then
response.write "<script language=javascript>alert('對不起,您還沒有登陸!');window.close();</script>"
response.End
end if
username=request.cookies("shopzhiwang")("username")
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 sh_chanpin where bookid="&request.form("bookid")(i),conn,1,1
if request.Cookies("shopzhiwang")("reglx")=1 then
danjia=rs_s("huiyuanjia")
else
danjia=rs_s("vipjia")
end if
kucun=rs_s("kucun")
bookname=rs_s("bookname")
rs_s.close
set rs_s=nothing
'response.write kucun&" "&bookcount
'response.end
if kucun<cint(bookcount) then
response.write "<script language=javascript>alert('您選購的商品“"&bookname&"”庫存不足,不能修改數量,請與我們聯系!');window.location.href='shopcart.asp?action=show';</script>"
response.end
end if
conn.execute("update sh_action set bookcount="&bookcount&",zonger="&danjia*bookcount&" where actionid="&request.form("actionid")(i))
next
response.Redirect "shopcart.asp?action=show"
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -