Hi
I'm trying to add items to an array each time the form is submitted so I will have an array of all options chosen from the picklist. This is instead of using radio or check buttons.
Problem i'm having, is each time the form is submitted, the value of the items in the array doesn't increase.
To help, here is the code i'm using:
<?
session_start();
if (!isset($_SESSION['values']))
{
$_SESSION['values'] = array();
}
if (isset($HTTP_GET_VARS['equipment']))
{
$_SESSION['values'][] = $HTTP_GET_VARS['equipment'];
}
echo count($_SESSION['values']);
?>
<form method="get" action="index.php">
<select name="equipment" size="1">
<option>Television</option>
<option>Camera</option>
<option>Computer</option>
</select>
<input type="submit" value="save">
</form>
I'm guessing I need something to keep increasing the SESSION['values'][] to SESSION['values'][$var], where $var increases on each submit, but can't get anything to do it.
Any help is much appreciated, thanks
Ant