Hi guys,
I'm new to ASP and need some array help.
I need to have a shopping cart. When you visit the site it creates a session and an array. When you click add to basket it adds the item ID to the array.
I can't get my head around how i allocate it an array slot and then empty out the array in the checkout. I presume i'd need a loop or something to go through each array item and print it out.
Thanks in advance,
Dave
1 1506
Hi guys,
I'm new to ASP and need some array help.
I need to have a shopping cart. When you visit the site it creates a session and an array. When you click add to basket it adds the item ID to the array.
I can't get my head around how i allocate it an array slot and then empty out the array in the checkout. I presume i'd need a loop or something to go through each array item and print it out.
Thanks in advance,
Dave
I'm not sure you can do an array in session variables. I would put one long string like this: - session("cart") = "playdough, fakeMoney, turtleFood"
-
session("cartQuant") = "1, 3, 2"
-
session("cartPrice") = "3.14, 2.79, 1.99"
-
then to access them I would create arrays using the split function: -
dim carts, cartQuants, cartPrices
-
carts = split(session("cart"), ", ")
-
'and so on
does this make sense?
Jared
Sign in to post your reply or Sign up for a free account.
Similar topics
by: KellyH |
last post by:
Hi, I hope someone can point me in the right direction.
I'll get it out of the way: Yes, I am a college student. No, I am not
looking for anyone to do my homework, just looking for help. I have...
|
by: bbxrider |
last post by:
i'm new to javascript but have programmed lots in vb, cobol, basic, etc
jscript seems much more object oriented to me, much more direct manipulation
of properties at least, than vb, don't know...
|
by: K. Shier |
last post by:
when attempting to edit code in a class file, i see the bug "Visual Basic
..NET compiler is unable to recover from the following error: System Error
&Hc0000005&(Visual Basic internal compiler...
|
by: Psykarrd |
last post by:
I am trying to declare a string variable as an array of char's. the
code looks like this.
char name;
then when i try to use the variable it dosn't work, however i am not
sure you can use it...
|
by: Jason Curl |
last post by:
Greetings,
I have an array of 32 values. This makes it extremely fast to access
elements in this array based on an index provided by a separate enum. This
array is defined of type "unsigned long...
|
by: bruce |
last post by:
hi...
i have the following test python script.... i'm trying to figure out a
couple of things...
1st.. how can i write the output of the "label" to an array, and then how i
can select a given...
|
by: Vince |
last post by:
Hello all,
I am using Visual Basic to open a saved query and then save
information in the query to an array for later use. The problem is
that the same query shows different results when opened...
|
by: Scott Stark |
last post by:
Hello,
I'm trying to get a better handle on OOP programming principles in VB.NET.
Forgive me if this question is sort of basic, but here's what I want to do.
I have a collection of Employee...
|
by: sheldonlg |
last post by:
This is kind of basic, and I googled but didn't find much help.
I have an array of text element fields. They all need to have the same
name. So, let the name be either all with a or build...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |