Hello,
I need to design a form to order some items. The items list come from a mySQL database.
And for each item i need to have one text field (to choose the quantity and i guess a checkbox so the user can choose what they want)
This is sounds confusing even for me ???
Anyone can tell me whats the best way to do this? i have the list of items and i need to let the user choose which ones they want and how many for each one.
I had only a checkox and the code was like this:
<?php do { ?><tr>
<td align="right"><label>
<input name="check[]" type="checkbox" id="checkbox" value="<?php echo $row_rs_manuais['titulo']; ?>" />
</label></td>
<td><?php echo $row_rs_manuais['titulo']; ?></td>
</tr> <?php } while ($row_rs_manuais = mysql_fetch_assoc($rs_manuais)); ?>
....
foreach($_POST['check'] as $value) {
$check_msg .= "$value
";
}
$headers = "MIME-Version: 1.0
";
$headers .= "Content-type: text/html; charset=iso-8859-1
";
$headers = "From: " . $_POST['nome'] . " <" . $_POST['email'] . ">
";
$body = "From: $nome
E-Mail: $email
Morada: $morada
Codigo Postal: $cod1-$cod2 $localidade
Telefone: $telefone
Fax: $fax
Empresa: $empresa
Numero de Contribuinte: $contribuinte
Manuais Encomendados:
$check_msg";