hi
this is my code but I can't see the array in echo
<table>
<tr>
<td>
<h3>
<?php
//if the cart is empty show the message
if (!$cart && !$_POST['item']) {
echo "No cart available.";
$cart = array();
}
else{
//if the new item added to the cart let the customer knows
if ($_POST['item']) {
echo "Added to your cart: " . $_POST['item'];
}
}
?>
</h3>
</td>
</tr>
<tr>
<?php
//if the cart isn't empty show the cart
if ($cart) {
$cart[] = $_POST['item'];}
foreach($cart as $key => $value) {
echo'<td>
<img src="images/'.$value.'.jpg" alt="'.$value.'" />
</td>
<td>
<form>
<p>
'.$value.' =
<input type="text" size="2" name="number" value="1" />
</p>
</form>
</td>
<td>
<form method="post" action="update.php">
<p>
<input type="submit" name="submit" value="Update This One Item" />
</p>
<form>
</td> <br />';
}
?>
</tr>
</table>