thank you for welcoming me and for replying
i'm using a previous form with sizes, i used the form with database, but now i just want to use it with sessions
so i add the user has a drop down list that asks him to choose a color, when he chooses one of the four colors and clicks add it takes him to a2.php and shows him that he has added the specific color and the quantity he added...
so if he presses back and adds the same color again it will show the color and the quantity as "2"
i'm sorry if my explanation is not clear....
i fixed the first part of the form...a1.php
<html>
<body>
<form id="color" method="post" action="a2.php">
<p>
<select name="color">
<option value="invalid">Select a size ...</option>
<option value="blue">blue</option>
<option value="red">red</option>
<option value="green">green</option>
<option value="orange">orange</option>
</select>
<br />
<input type="Submit" value="Add" name="Add" />
</p>
</form>
</body>
</html>
a2.php
<?php session_start();
$item_id = $POST[id];
$action = $PST[add];
switch($action)
{
case "add":
$_SESSION['color'][$item_id]++;
break;
case "remove":
$_SESSION['color'][$item_id]--;
if($_SESSION['color'][$item_id] == 0) unset($_SESSION['color'][$item_id]);
break;
case "empty":
unset($_SESSION['color']);
break;
}
?>
i don't know if i got this right...