CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

有购物车的添加程序吗?

楼主arpenker(爱拼客)2005-05-19 22:44:42 在 Web 开发 / ASP 提问

哪位大侠有购物车的添加程序吗?(商品点击页代码和添加页代码) 问题点数:20、回复次数:3Top

1 楼arpenker(爱拼客)回复于 2005-05-20 20:45:20 得分 0

??????????????????????????????request.form   ("*.*")Top

2 楼victorhero(游神)回复于 2005-05-20 22:28:05 得分 20

自己在网上搜搜啊。  
  产品页面:  
        <table   width="100%"   border="0"   cellspacing="0"   cellpadding="0"   align="center"   class="new">  
                                                      <tr   valign="middle">    
                                                          <td   height="40"   colspan="2">简&nbsp;&nbsp;介:<%=ProdDisc%></td>  
                                                      </tr>  
                                                      <tr>    
                                                          <td   valign="bottom"   width="79%">  
   
  市场价:<b><s><%=newprod("PriceOrigin")%></s>   元</b><br>  
   
   
  热卖价:<%if   newprod("PriceList")=0   then  
  response.write   "<b><font   color=red>请咨询客服...</font></b></td>"  
  else  
  response.write   "<b><font   color=red>"&newprod("PriceList")&"   元</font></b></td>   <td   align=center   valign=bottom   width=21%   ><a   href=#   onClick=""window.open('order/add.asp?ProdId="&newprod("ProdId")&"','blank_','scrollbars=yes,resizable=no,width=650,height=450')""><img   src='images/mybuy.gif'   width=48   height=17   border=0></a></td></tr>"  
  end   if  
      %>                                                          
                                                  </table>  
   
  add.asp  
  <%  
  Sub   PutToShopBag(   Prodid,   ProductList   )  
        If   Len(ProductList)   =   0   Then  
              ProductList   =   "'"   &   Prodid   &   "'"  
        ElseIf   InStr(   ProductList,   Prodid   )   <=   0   Then  
              ProductList   =   ProductList   &   ",   '"   &   Prodid   &   "'"  
        End   If  
  End   Sub  
  %>  
  <%  
  ProductList   =   Session("ProductList")  
  Products   =   Split(Request("Prodid"),   ",")  
  For   I=0   To   UBound(Products)  
        PutToShopBag   Products(I),   ProductList  
  Next  
  Session("ProductList")   =   ProductList  
   
  response.redirect"order_check.asp"  
  %>  
   
  order.asp  
  <!--#include   file="../Comm/subconn.asp"   -->  
  <%on   error   resume   next%>  
   
  <%  
  '判断是否需要注册  
  if   reg<>"1"   then  
  '判断是否正常购买,如果不是,需要登陆  
  if   session("estore_userid")=""   then    
  response.redirect   "../error.asp?error=006"  
  response.end  
  end   if  
  end   if  
   
  '判断购物车是否为空  
  ProductList   =   Session("ProductList")  
  if   productlist<>""   then  
  sql="select   *   from   ProdMain   where   ProdId   in   ("&productlist&")   order   by   ProdId"  
  Set   rs   =   conn.Execute(   sql   )  
  else  
  response.redirect   "../error.asp?error=007"  
  response.end  
  end   if  
  %>    
  <html>  
  <head>  
  <title>填写订单详细信息</title>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <meta   name="Robots"   content="index,follow">  
  <meta   name="Abstract"   content="CycooShop">  
  <meta   name="DC.Publisher"   content="Cycoo   Net   Studio">  
  <meta   name="Description"   Content="欢迎使用   CycooShop   专业的电子商务平台   下载地址   www.cycoo.com">  
  <meta   name="Keywords"   Content="思高商城   免费下载">  
  <link   rel="stylesheet"   href="../cycoo15.css"   type="text/css">  
  <script   language="JavaScript">  
  function   CheckForm()  
  {  
  if   (document.payment.Recname.value.length   ==   0)   {  
  alert("请输入收货人的   姓名.");  
  document.payment.Recname.focus();  
  return   false;  
  }  
   
  if   (document.payment.address.value.length   ==   0)   {  
  alert("请输入收货人的   地址.");  
  document.payment.address.focus();  
  return   false;  
  }  
   
          if   (document.payment.paytype.value.length   ==   0)   {  
  alert("请选择您的支付方式.");  
  document.payment.paytype.focus();  
  return   false;  
  }  
   
  if   (document.payment.Recmail.value.length   ==   0)   {  
  alert("请输入此订单收货人的EMAIL.");  
  document.payment.Recmail.focus();  
  return   false;  
  }  
  if   (document.payment.Recmail.value.length   >   0   &&   !document.payment.Recmail.value.match(   /^.+@.+$/   )   )   {  
          alert("EMAIL   错误!请重新输入");  
          document.payment.Recmail.focus();  
  return   false;  
  }  
   
  if   (document.payment.RecPhone.value.length   ==   0)   {  
  alert("请收货人的电话.");  
  document.payment.RecPhone.focus();  
  return   false;  
  }  
   
  return   true;  
  }  
   
  </script>  
  </head>  
  <body   bgcolor="#FFFFFF"   text="#000000"   leftmargin="0"   topmargin="0">  
    <br>  
  <table   border="0"   cellspacing="1"   cellpadding="0"   align="center"   width="520"   bgcolor="B0266D">  
      <tr   bgcolor="#FFFFFF">    
          <td   colspan="4"   height="25">&nbsp;&nbsp;<font   color=B0266D><%=session("estore_userid")%>   您选购的商品清单如下:</font>    
          </td>  
      </tr>  
      <tr   bgcolor="#FFFFFF">    
          <td   width="50%"   height="25"   align="center">    
              <font   color="B0266D">商   品   名   称</font>  
          </td>  
          <td   width="10%"   align="center">    
              <font   color="B0266D">数   量</font>  
          </td>  
          <td   width="20%"   align="center">    
            <font   color="B0266D">单   价</font>  
          </td>    
  <td   width="20%"   align="center">    
            <font   color="B0266D">合   计</font>  
          </td>  
      </tr>  
  <%  
        Sum   =   0  
        While   Not   rs.EOF  
            Quatity   =   CInt(   Request(   "Q_"   &   rs("ProdId"))   )  
            If   Quatity   <=   0   Then    
                  Quatity   =   CInt(   Session(rs("ProdId"))   )  
                  If   Quatity   <=   0   Then   Quatity   =   1  
            End   If  
            Session(rs("ProdName"))   =   Quatity  
            Sum   =   Sum   +   csng(rs("PriceList"))   *   Quatity  
            Sum=FormatNumber(Sum,2)    
  session("sum")=sum  
  %>    
      <tr   bgcolor="#FFFFFF">    
          <td   width="50%"   height="20">&nbsp;<font   color="B0266D"><%=rs("ProdName")%></font></td>  
          <td   width="10%">&nbsp;<font   color="B0266D"><%=Quatity%></font></td>  
          <td   width="20%">&nbsp;<font   color="B0266D"><%=FormatNumber(rs("PriceList"),2)%></font></td>  
  <td   width="20%">&nbsp;<font   color="B0266D"><%=FormatNumber(csng(rs("PriceList"))*Quatity,2)%></font></td>  
      </tr>  
  <%  
  rs.MoveNext  
  Wend  
  rs.close  
  set   rs=nothing  
  %>    
      <tr   bgcolor="#FFFFFF">    
          <td   colspan="4"   height="25"   align="right">    
              <b><font   color="#B0266D">总价格=<%=Sum%></font>&nbsp;&nbsp;  
          </td>  
      </tr>  
  </table>  
  <br>  
  <br>  
  <table   border="0"   cellspacing="1"   cellpadding="3"   align="center"   width="520"   bgcolor="B0266D">  
      <form   name="payment"   action="previeworder.asp"   method="POST"     onSubmit="return   CheckForm();">  
  <%  
  sql="select   *   from   UserMain   where   userid='"&session("estore_userid")&"'"  
  set   rs=server.createobject("adodb.recordset")  
  rs.open   sql,conn,1,1  
  Zipcode=rs("ZipCode")  
  HomePhone=rs("HomePhone")  
  address=rs("Address")  
  email=rs("UserMail")  
  name=rs("UserName")  
  rs.close  
  set   rs=nothing  
  %>  
          <tr   bgcolor="#FFFFFF">            
              <td   width="20%">&nbsp;收货人姓名</td>  
              <td   width="30%"><input   type="text"   name="Recname"   class="form"   size="15"   value=<%=name%>>  
                  <b><font   color="#FF3333">*</font></b>   </td>  
          <td>&nbsp;收货人电话</td>  
              <td><input   type="text"   name="RecPhone"   class="form"   size="15"   value=<%=HomePhone%>>  
                  <b><font   color="#FF3333">*</font></b>   </td>  
  </tr>  
          <tr   bgcolor="#FFFFFF">    
          <td   height="27">收货人邮箱</td>  
              <td   height="27"><input   type="text"   name="Recmail"     size="16"   value=<%=email%>>   <b><font   color="#FF3333">*</font></b></td>  
  <td   height="30">支付方式</td>  
  <td><select   name="paytype">  
                      <option   value=""   selected>请选择支付方式</option>  
  <%  
  sqlp="select   paytype   from   paydefault"  
  set   rsp=server.createobject("ADODB.Recordset")  
  rsp.open   sqlp,conn,1,1  
  while   not   rsp.eof  
  %>    
                      <option   value="<%=rsp("paytype")%>"><%=rsp("paytype")%></option>  
                      <%  
  rsp.movenext  
  wend  
  rsp.close  
  set   rsp=nothing  
  %>    
                  </select>  
              </td>  
          </tr>  
   
          <tr   bgcolor="#FFFFFF">              
      <td   height="30">邮政编码</td>  
              <td   colspan=3>    
                  <input   type="text"   name="ZipCode"   size="15"   value=<%=Zipcode%>>  
                  </td>  
                  </tr>  
  <tr   bgcolor="#FFFFFF"><td   height="30"   >  
                  收货人地址</td><td   colspan=3><input   name="address"   size=45   value='<%=address%>'><b><font   color="#FF3333">*</font></b></td>  
          </tr>  
  <tr   bgcolor="#FFFFFF"><td   height="30"   >备注留言</td><td   colspan="3">  
                  &nbsp;    
                  <textarea   name="Notes"   cols="35"   rows="4"></textarea>                  
                </td>  
          </tr>  
          <tr   bgcolor="#FFFFFF">    
              <td   height="35"   colspan="4"   align="center">    
              <input   type=hidden   name="Sum"   value="<%=Sum%>">  
  <input   type="button"   name="Submit21"   onclick="javascript:history.go(-1)"   value="&lt;&lt;   返回修改">  
                  &nbsp;&nbsp;&nbsp;  
                      <input   type="submit"   name="nextstep"   value="确认订单   >>">  
                      &nbsp;&nbsp;&nbsp;    
                      <input   type="reset"   name="reset"   value="重新填写信息">  
              </td>  
          </tr>  
      </form>    
  </table>  
  </body>  
  </html>  
  <%  
  set   conn=nothing  
  %>Top

3 楼victorhero(游神)回复于 2005-05-20 22:29:26 得分 0

就是产品页面给个链接'order/add.asp?ProdId="&newprod("ProdId")&"‘Top

相关问题

  • 求一网上购物车程序
  • 我想用ASP写个购物车的程序,可是……
  • 如何控制购物车程序的窗口数目?
  • 程序员一天的郁闷之五(关于购物车的编写)
  • 购物车程序(servlet)异常执行,解决问题马上散分
  • 如何将类添加到程序中?
  • 如何在dialog程序中添加statusbar?
  • JB7中怎么添加servlet程序
  • 添加删除程序里的问题
  • Windows 程序中添加Web引用

关键词

  • 收货人

得分解答快速导航

  • 帖主:arpenker
  • victorhero

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo