Best way to go about this? [PHP]

Soldato
Joined
25 Oct 2006
Posts
5,395
Hi all

So I need to make an order form which lists a few products, you select quantity and then postage choice and then checkout and ask customer for address and CC details. Finally display an order confirmation.

My query is about storing the user's choices and the products. I was thinking create an array to store each product and its price, for listing them in form. Then to carry that information to the order confirmation I could use a multi-dimensional array to store the price, product, and quantity ordered. Is there a better way or a good way without using multi-dimensional arrays?

Thanks!

P.S. It's only a basic order form, not going to be used in a live environment at all.
 
so a var for each product? This doesn't seem particularly expandable, and if I have lots of products will mean lots of vars.

I would rather not use sessions or databases in this example.
 
Back
Top Bottom