Post a session variable to a shopping cart table.
I am trying to post a session variable generated from a login page to to a shopping cart so that I can then filter the contents of the cart by user. The cart is a table in a MYSQL/PHP database.
I have very little experience in php/mysql so I am probably doing some thing fundamentally wrong.
- At present, a user has to login before adding a product to the cart - this has been set up in the behaviours panel.
- A form has been set up on my product page so that when the "buy" button is clicked, the product_id, quantity of the item etc is inserted into the shopping cart table.
- I have tried to use the bindings panel to additionally add the username which I beleieve has been set up as a session variable from the login page and have included it in a hidden field on the form but when I look at the table in phpMyAdmin the following appears in my session variabe column:
- <br /> <b>Notice</b>: Undefined variable: _SESSION in <b>C:\wamp\www\boutique_wines\wine.php</b> on line <b>114</b><br />
- Line 114 reads as follows: <input name="username" type="hidden" id="username" value="<?php echo $_SESSION['MM_Username']; ?>" />
Please help
Mark
