类型不匹配:'arrCart'第六行

mengqingren2008 2004-02-13 02:36:38
<%
dim conn,rs,sql,htmlcode
%>
<!--#include file="includes/dbconn.inc"-->
<%
arrCart = Session("myCart")
CartIndex = Session("cartIndex")
count=0
for i=0 to CartIndex
if arrCart(i,2)<>"" then
if arrCart(i,2)>0 then
count=count+1
end if
end if
next
if count = 50 then
response.redirect"showmsg.asp?msg=购物车已满!"
end if
idbook = request.form("idbook")
bookname = request.form("bookname")
purchase = request.form("purchase")
availstock = request.form("availstock")
if purchase <>"" then
purchase=Cint(purchase)
availstock=Cint(availstock)
if purchase>availstock then
htmlcode="你购买地数量超过了库存图书的数量! <a href=""viewitem.asp?idbook="&idbook&"&bookname="&bookname&""">返回</a>"
response.write htmlcode
else
if purchase>0 then
call openDB()
sql="select price,discount from books where idbook="&idbook&" and bookname='"&bookname&"'"
set rs=conn.execute(sql)
nowprice=rs("price")*(100-rs("discount"))/100
arrCart(CartIndex,0) = idbook
arrCart(CartIndex,1) = bookname
arrCart(CartIndex,2) = purchase
arrCart(CartIndex,3) = nowprice
session("myCart") = arrCart
CartIndex = CartIndex + 1
Session("cartIndex") = CartIndex
call closeDB()
end if
response.redirect "showcart.asp"
end if
else
response.write"你没有选择图书数量!"
end if
%>
...全文
67 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧