I am building a photographer's web site where he offers his clients the option of placing an order online. It is not an eCommerce store, but simulates like one. There is no money transactions going on. The user will navigate to a photo and then add to cart. The items are kept in a SESSION on the server and then the user can go shop for more photos. Once the shopping is completed the user sends the order to the photographer via a form which has been collecting everything they have ordered.
Here is a link to a page where you will see the photo to purchase and the selections/options of what to order from that photo. (http://www.sc-photo.com/order/browsePho ... 27&pID=316)
The navigation is working fine. Here is my problem. I have no idea how to make the forms on this page submit SESSION variables of the selected data (photoID, clientID, photoSIZE(s), etc. (you can see the options on the form). Where should I begin? Where should I turn to get some sort of guidance and direction?
Thanks.
Ordering Items
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Code: Select all
echo '<input type="hidden" name="something" value="'.$_SESSION['something'].'">';EDIT | Oh I see.... yes, use hidden form fields. If you need to keep info bundled together you can set your names to be arrays....
Code: Select all
echo '<input type="hidden" name="item['.$_SESSION['id'].']" value="'.$_SESSION['item'].'">';
echo '<input type="hidden" name="size['.$_SESSION['id'].']" value="'.$_SESSION['size'].'">';
//after posting you'd have something like
// $_POST['item'][8743] = 'Red Lantern Photo';
// $_POST['size'][8743] = '6x4';