Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 6th, 2007, 10:13 AM
Friend of Wrox
 
Join Date: May 2005
Location: , , .
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
%>


Reply With Quote
  #2 (permalink)  
Old January 9th, 2007, 10:16 PM
Authorized User
 
Join Date: Jan 2007
Location: Minneapolis, Mn, USA.
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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:48 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.