If the items in <select> drop down menu are populated from mysql DB, like:
<?
echo "<select name=ptype>";
echo "<option value=\"\">------Select------</option>";
for ($i = 0; $i < mssql_num_rows( $result0 ); ++$i)
{
$line = mssql_fetch_row($result0);
echo "<option value=$line[0]>$line[1]</option>";
}
echo "</select>";
?>
Now I want to submit this form and if I want to pass another hidden data for each <select> item, I tried to use:
echo "<option value=$line[0]>$line[1]</option>";
echo "<input type=hidden name=a[$i] value=$line[2]>";
}
However it seems to add hidden value inside <select> loop will not work, I don't want to concatenate hidden value "$line[2]" to the option value "$line[0]", how can I pass the hidden values?
Thanks for any advice.