Jump to content

Adding form variables into session cart


petenaylor

Recommended Posts

Hi all

 

I have a php form as follows:

 

<form action="basket.php?action=add&id=1&qty=1" method="post" name="buy-product">

<input name="initial_1" id="initial_1" type="text" size="8" maxlength="1" />

<input name="initial_2" id="initial_2" type="text" size="8" maxlength="1"  />

<input name="initial_3" id="initial_3" type="text" size="8" maxlength="1"  />

<input name="send" type="submit" class="contact-form-button" id="send" value="Submit" />

 

Basically I need to add the three initials into a session so that they can be shown in the shopping cart next to the product.

 

How do I add the initials to the session and how do I output them to the shopping cart?

 

At the start of my basket.php script I have:

 

$cart = $_SESSION['cart'];

$action = $_GET['action'];

$id = $_GET['id'];

$qty = $_GET['qty'];

$initial_1 = $_POST['initial_1'];

$initial_2 = $_POST['initial_2'];

$initial_3 = $_POST['initial_3'];

 

I now need to create a table with the cart showing item, price and initials.

 

Cheers

Pete.

Link to comment
https://forums.phpfreaks.com/topic/214525-adding-form-variables-into-session-cart/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.