Good'ay
I am very new to PHP and just cant seem to get this right. I have created what is hi-lighted in red below from tutorials/manuals etc and really have no idea what I'm doing yet.
I am trying to add 2 drop down lists to the view item page of my shopping cart so as users can select colours.
The info is writing to the data base as 'array' in both fields, instead of the selected fields-
I have tried a couple of different formats - always with the same result.
Any pointers in the right direction greatly appreciated
cheers
<!-- view item table start -->
<table align=left width=400 border=0>
<tr>
<td valign=top width=120><?=$DisplayImage?></td>
<td width=280 valign=top>
<font color=black face=verdana size=2><b><?=$a1[ItemName]?></b></font>
<br>
<font color=black face=verdana size=1><b>Category:</b></font> <?=$DisplayCategory?>
<br>
<font color=red face=verdana size=2><b>Price: $<?=$DisplayPrice?></b></font>
<br>
<p><b><font size="2">Please choose your colours before<br>
adding to your cart </font></b></p>
<table style="border-collapse: collapse;" cellpadding="0" cellspacing="0" width="242">
<tr>
<td width="123"><font size="2">Cloth Colour:</font></td>
<td width="116">
<?
$ItemClothcolour = array(
0=> "",
1=> "Porcelain",
2=> "Sandstone",
3=> "Navy Blue",
4=> "Midnight Green",
5=> "Aquamarine",
);
$ItemClothcolour = str_replace(" ", " ", $ItemClothcolour);
echo '<SELECT name=ItemClothcolour>';
foreach ($ItemClothcolour as $key => $value)
{
echo '<OPTION value='.$value.'> '.$value.'';
}
echo '</select>';
?>
</td>
</tr>
<tr><td width="123">
<p><font size="2">Webbing Colour: </font></td>
<td width="116">
<?
$ItemWebcolour = array(0=> "", 1=> "Black",2=> "White",);
$ItemWebcolour = str_replace(" ", " ", $ItemWebcolour);
echo '<SELECT name=ItemWebcolour>';
foreach ($ItemWebcolour as $key => $value)
{
echo '<OPTION value='.$value.'> '.$value.'';
}
echo '</select>';
?>
</select></td>
</tr>
</table>
<p><br>
</p>
<form method=post action=add.php>
<input type=hidden name=ItemID value="<?=$a1[ItemID]?>">
<input type=hidden name=ItemName value="<?=$a1[ItemName]?>">
<input type=hidden name=ItemClothcolour value="<?=$ItemClothcolour?>">
<input type=hidden name=ItemWebcolour value="<?=$ItemWebcolour?>">
<input type=hidden name=ItemShipping value="<?=$a1[ItemShipping]?>">
<input type=hidden name=ItemPrice value="<?=$DisplayPrice?>">
<input type=image src=images/img_20.gif border=0 name=s1 value="Add to cart" class=sub>
</form>
</td>
</tr>
<tr>
<td colspan=2><?=$DisplayDescription?></td>
</tr>
<tr>
<td colspan=2 align=center><?=$DisplayRateing?></td>
</tr>
</table>
<!-- View Item table end -->