⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addto.asp

📁 电子商务网络购物系统
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<head>
<title><%=webname%>--我的收藏架</title>
<link href="include/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="3" topmargin="5" marginwidth="0" marginheight="0">
<%
if request.cookies("timesshop")("username")="" then
response.write "<script language=javascript>alert('对不起,您还没有登录!');history.go(-1);</script>"
response.End
end if
dim id,username,action
action=request.QueryString("action")
username=trim(request.cookies("timesshop")("username"))
id=request.QueryString("id")

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

case "add"
set rs=server.CreateObject("adodb.recordset")
rs.open "select id,username from orders where username='"&username&"' and id="&id&" and state=6",conn,1,1
if not rs.eof and not rs.bof then
response.write "<script language=javascript>alert('对不起,此商品已存在于您的收藏架中,不可以重复添加!');history.go(-1);</script>"
response.end
rs.close
set rs=nothing
else

if rs.recordcount=10 then
response.write "<script language=javascript>alert('对不起,您的商品收藏已超过10个!');history.go(-1);</script>"
response.end
else
rs.close
set rs=nothing

set rs=server.CreateObject("adodb.recordset")
rs.open "select id,username,state,paid from orders",conn,1,3
rs.addnew
rs("id")=id
rs("username")=username
rs("state")=6
rs("paid")=0
rs.update
end if
rs.close
response.Redirect "addto.asp?action=show"
set rs=nothing
end if
case "show"
%>
<!--#include file="disuser.asp"-->
<%response.write "<table width=96% border=0 align=center cellpadding=2 cellspacing=2><tr><td width=60% >"
response.write "</td><td width=40% valign=baseline><div align=right>您最多只能收藏十种商品</div></td></tr></table>"
addtocart()
end select%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -