Using ASP to process forms

Results 1 to 2 of 2

Thread: Using ASP to process forms

  1. #1
    Join Date
    Dec 1969

    Default Using ASP to process forms

    I&#039m currently working on a project to realize an e-commerce solution for the company I work for.<BR><BR>I have decided to use the cart32 program as my shopping cart.<BR><BR>Heres where my problem comes in, this program is capable of calling a script (cgi, or ASP) after an order is confirmed, and it passes fields to this script in the same manner as a form would.<BR><BR>My problem is it generates variable in this manner :<BR><BR>NumberOfItems <BR>ItemX <BR>QtyX<BR>PriceX <BR>OptionsX <BR>TotalX<BR><BR>where X is the ordered product number (ie Item1 is the first ...)<BR>as you can see it creates a seperate variable name for each product, is there a way I can use a loop to access the variables in this format?<BR><BR>ie, <BR><BR>for i = 1 to NumberOfitems<BR>someVar = qty(i)<BR>next<BR><BR>Any help or redirection towards help would be greatly appreciated.<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Using ASP to process forms

    This should work:<BR><BR>NumberOfItems=request.form("NumberOfI tems")<BR><BR>For Lcounter=1 to NumberOfItems <BR><BR>Item=Request.Form("Item"&Lcounter)<BR>Pric e=Request.Form("Price"&Lcounter)<BR>Quantity=Reque st.Form("Quantity"&Lcounter)<BR>Total=Request.Form ("Total"&Lcounter)<BR>Lcounter=Lcounter+1<BR><BR>& #039Do whatever with the data here like write or put in database<BR><BR>next<BR><BR>Good Luck<BR>Brandon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts