<%
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
%>
错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: 'arrCart'
请教版主怎么解决啊