Hi broady,
Sure. What you mention is straightforward, although you could make it very complex.
Starting a session: Before you do anything at all on your page (Do not even output a single space from your your page to the client) put this:
<?php
session_start();
?>
This will get the session going, and retrieve any information already stored in the session.
Next you need to add a form to the product pages. Ideally you use a unique identifier to define the product, e.g., the ID from the database in which the product resides, if run from a database.
In the form you have 3 fields: product identifier, quantity and action='add'.
Right after you have started the session you will need a script that check whether a form was submitted, and if so, add the item to your session:
<?php
session_start();
if(isset($_POST['action'] && $_POST['action'] == 'add')
{
// assuming you use numbers in the product id:
if(is_numeric($_POST['product']) && is_numeric($_POST['quantity'])
{
$_SESSION[$_POST['product']] = $_POST['quantity'];
}
}
?>
That should get you going