help please!!!!!!! setting a session array equal

Results 1 to 2 of 2

Thread: help please!!!!!!! setting a session array equal

  1. #1
    Join Date
    Dec 1969

    Default help please!!!!!!! setting a session array equal

    I have a shopping cart that was working fine. However, when I added 2 different items, it won&#039t display right. My problem is that the page creates a 2 dimensional session array with space for the item price, name, quantity, and ID. Then it uses a for next loop to go through the array to show the customer their order. Unfortunately, I can&#039t keep the order in a session because to checkout, they have to go to a different server and therefore the 2nd server obviously can&#039t do a request for the session variable. I have to figure out a way to go through my session array that holds my order info and set it all equal to a variable that I can then include as a hidden field in my form. Does anyone have any clue how I might be able to do this? Please help quickly, this site is operational and I need to get it done now!!! Thanks a million!

  2. #2
    Join Date
    Dec 1969

    Default Why not use hidden throughout?

    But never mind...let&#039s not change too many things at once...<BR><BR>So you want to convert the session array to hidden fields?<BR><BR>Why not just do something like this:<BR><BR>***************<BR><BR>&#060;FORM ....&#062;<BR>... non hidden fields here? ...<BR>&#060;%<BR>theArray = Session("storedArray")<BR>&#039 I might have row and column backwards from how you <BR>&#039 did them...hope not, becuz this way is superior for<BR>&#039 ReDim Preserve...but anyway, just swap if need be<BR>rowCount = UBound(theArray,2)<BR>colCount = UBound(theArray,1)<BR>Response.Write "&#060;INPUT Type=Hidden Name=rowCount Value=" & rowCOunt & "&#062;" & vbNewLine<BR>Response.Write "&#060;INPUT Type=Hidden Name=colCount Value=" & colCOunt & "&#062;" & vbNewLine<BR>For row = 0 To rowCount<BR>&nbsp;&nbsp;&nbsp;&nbsp; For col = 0 To colCount<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; Response.Write "&#060;INPUT Type=Hidden Name=Row" & row & "Col" & col _<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; & " Value=&#039" & theArray(col,row) & "&#039&#062;" & vbNewLine<BR>&nbsp;&nbsp;&nbsp;&nbsp; Next<BR>Next<BR>%&#062;<BR>...<BR>&#060;/FORM&#062;<BR><BR>****************<BR>Those aren&#039t exciting hidden field names, but so what? They would work to transfer the array to the next page, wouldn&#039t they?<BR><BR>You could even re-establish the array in the next page by doing something like:<BR><BR>&#060;%<BR>rowCount = Request("rowCount")<BR>colCount = Request("colCount")<BR>dim theArray( )<BR>ReDim theArray(colCount, rowCount)<BR>For row = 0 To rowCount<BR>&nbsp;&nbsp;&nbsp;&nbsp; For col = 0 to colCount<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; theArray(col,row) = Request("Row" & row & "Col" & col)<BR>&nbsp;&nbsp;&nbsp;&nbsp; Next<BR>Next<BR>%&#062;<BR>

Posting Permissions

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