设为首页收藏本站

新微赢技术网

 找回密码
 注册
搜索
热搜: 回贴
查看: 47|回复: 1
打印 上一主题 下一主题

[求助]asp 缺少语句

[复制链接]
跳转到指定楼层
1#
发表于 2009-12-27 05:20:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
各位大侠小弟编写的购物车除了点问题!
错误类型:
Microsoft VBScript 编译器错误 (0x800A0400)
缺少语句
/viewcart.asp, line 76
<input type=button name="close" value="继续购物" onclick="window.close()">&nbsp;


源文件

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<! --include file="config.inc"-->
<%
'函数sqlstr 用来规范sql查询语句
function sqlstr(data)
sqlstr="'" & replace(data,"'","''") & "'"
end function
'连接数据库
set conn=server.createobject("adodb.connection")
conn.open connstring
set objbuyrs=server.createobject("adodb.recordset")
if session("insert")=sessionid then
session("insert")=false
for each key in request.Cookies("itembuy")
response.Cookies("itembuy")
next
end if
if not request.Cookies("itembuy").haskeys then
response.Write "<font style=""font:10pt;color:ff0000"">目前您的购物车里还没有商品</font>"
session("hasitem")=false
response.Write "<input tyle=button value=""继续购物"" onclick=""window.close()"">"
else
point=1 '循环变量用来遍历cookies字典itembuy
count=cint(request.Cookies("itembuy".count) ) '字典关键字的数量

do while point<=count
if request.Cookies("itembuy")(point)="" then
point=point+1 '如果此关键字为空,则继续循环
else
exit do
end if
loop
if point>count then
response.Write "<font stlyle=""font:10pt;color:ff0000"">目前您的购物车里没有商品</font>"
session("hasitem")=false
response.Write "<hr color=#999933 size=1>"
response.Write "<input tyle=button value=""继续购物"" onclick=""window.close()"">"
else
response.Write "<font style=""font:10pt;color:ff0000"">您已经选择了以下商品<br>如果有您不需要的,在购买数中输入0就即可</font>"
response.Write "<hr color=#999933 size=1>"
response.Write "<center><table><tr><td width=50>编号</td><td width=150>名称</td><td width=100>单价</td><td width=100>购买数</td></tr>"
response.Write "<form action=""forinvoice.asp"" method=post target=""main"" name=""view"">"

do while point<=count
'获取商品的编号
productid=request.Cookies("itembuy")(point)
if productid="" then
point=point+1
else
ssql="select * from product where productid=" & sqlstr(productid)
objbuyrs.activeconnection=conn
objbuyrs.source=ssql
objbyrs.open

response.Write "<tr><td>" & objbuyrs("productid") & "</td>"
response.Write "<td>" & objbuyrs("name") & "</td>"
response.Write "<td>" &objbuyrs("price") & "</td>"
nametemp=objbuyrs("productid")
response.Write "<td><input type=text size=2 value=1 name=" & nametemp &"></td>"
response.Write "</tr>"
point=point+1
if point>request.Cookies("itembuy").count then
exit do
end if
objbuyrs.close
end if
loop
response.Write "</table>"
conn.close
set conn=nothing

response.Write "<hr color=#999933 size=1>"

<input type=button name="close" value="继续购物" onclick="window.close()">&nbsp;

<input type=button NAME="remove" value="清空购物车" onclick="window.open('removecart.asp','_self')">
</form>
<%
end if
end if
%>

<html>
<head>
<meta http-equiv="Content-language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查看购物车</title>
<style><!--
td{font:10pt;color:#6600ff;}
input{background-color:#eeeeee;border-stye:solid;border-color:#6666cc;border-width:1;}
--></style>
</head>
<body style="font:10pt" bgcolor="ffffff">
</body>
</html>
<script language="vbscript">
<!--
sub view_onsubmit()
window.close()
end sub
-->
</script>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

申请友链|小黑屋|最新主题|手机版|新微赢技术网 ( 苏ICP备08020429号 )  

GMT+8, 2024-11-19 04:35 , Processed in 0.101547 second(s), 9 queries , Gzip On, Memcache On.

Powered by xuexi

© 2001-2013 HaiAn.Com.Cn Inc. 寰耽

快速回复 返回顶部 返回列表