Hi,
I read data from a mysql table, then I put it in a combobox, but I don't know how to put it forward.
I select a category in the combobox and I would like to have the selected category shown in selected.php
Anyone knows the solution?
<form action="selected.php" method="post">
<table cellspacing="2" cellpadding="2" border="0" style="WIDTH: 412px; HEIGHT: 232px">
<tr>
<td width="130">Category</td>
<td><select name=category[] size=<? echo count($cat)+1; ?>style="WIDTH: 207px">
<?
while($cat=mysql_fetch_array($result, MYSQL_ASSOC))
{
while(list($key, $val1) = each($cat))
{
echo "<option value=$key";
for($i=0;$i<count($cat);$i++)
{
if ($cat[$i]==$key)
{
echo " selected";
}
}
echo ">$val1\n";
}
}
?>
</td>
</tr>
</form>