Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 6th, 2007, 10:13 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default shopping cart

I have a table called shoppinggift registry which stores the items users adds as gifts
and includes these fields:
productID,Quantity,UnitPrice

I have another table called shoppingCart and as the name says it stores the products of stores which are added to shopping cart
fields are:orderID,productID,price

Now i have output the table to show for ex all the gifts of user A on the page
for ex he has 3 gifts
how can I add these records on the next page(when user clicks checkout) to the shopping cart
if it was 1 records i could use a hidden ID field but now these are more than 1 field

here is the page:
set RsReg=server.createobject("adodb.recordset")
RsReg.open "select P.productID,P.productName,R.productID,R.regID,R.un itPrice,R.amountRemain,R.Quantity from Shop_registryItems R left outer join Shop_Products P on R.productID=P.productID where regID=" & intID ,Conn,0,1


if rsReg.eof then
%>
<table class=err align=center>
    <tr>
    <td>
    <p align="center">item does not exist</td>
    </tr>
</table>

<%
  response.end
   end if


 session("userGiftRegistryID")=rsReg("regID")
%>
       <br>
  <form action="checkoutRegistry.asp" method="post" id="form1" name="form1" >
 <table class=subnav2 align=center>
     <tr bgcolor="#ff9900">
 <td width="44%" align="center" valign="center" ><strong>Product Name<strong></strong></strong></td>
 <td width="22%" align="center" valign="center"><strong>Quantity<strong></strong></strong></td>
 <td width="23%" align="center" valign="center"><strong>Unit Price<strong></strong></strong></td>
 <td width="25%" align="center" valign="center" ><strong>Balance Remaining<strong></strong></strong></td>
 <td width="15%" align="center" valign="center" ><strong>Quantity<strong></strong></strong></td>
 <td width="25%" align="center" valign="center" ><strong>Partial Purchase<strong></strong></strong></td>
 </tr>


<%

   while not RsReg.EOF

   intProdID = RsReg("productID")
%>
<input type=hidden name=pid value="<%= rsReg("productID") %>">

<tr>
            <td width="15%" valign="center" align="left" nowrap> <%= rsReg("productName") %></td>
            <td width="22%" align="center">&nbsp;<%= rsReg("quantity") %> </td>
                <td width="23%" align="center">&nbsp;<%= rsReg("unitPrice") %>$ </td>
                <td width="44%" align="left">&nbsp;<%= rsReg("amountRemain") %>$ </td>
                <td width="16%" align="center">
                         <input name="quant<%= intProdID %>" size="3" value="1" class=field>$
                </td>
                <td width="25%" align="right">
                        OR $<input name="quant<%= intProdID %>" size="3" value="" class=field>
                </td>
            </tr>

<%
RsReg.MoveNext
wend

RsReg.Close
set RsReg = Nothing
%>


 
Old January 9th, 2007, 10:16 PM
Authorized User
 
Join Date: Jan 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Build a redirect statement
dim moveon
moveon=nextpage.asp?user=

response.redirect(moveon)+username+"&pid="+pid.... ....
or you can simple use multiple hidden values in HTML and request all of them on the next page...either way should work.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Shopping Cart seannie ASP.NET 2.0 Basics 0 December 12th, 2006 10:28 AM
Shopping cart help rsm42 ASP.NET 1.0 and 1.1 Basics 3 December 9th, 2006 06:09 AM
shopping cart xipnl BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 June 10th, 2005 07:00 PM
shopping cart isheikh BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 October 8th, 2004 04:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.