You create an array of checkboxes by appending square brackets to the end of their name - using the same name. NB only checked items will be posted, the others will just disappear - into Santa's flight path
Something like this:
Code:
<input type='checkbox' value="Product1" name='cBox[]'/>
<input type='checkbox' value="Product2" name='cBox[]'/>
<input type='checkbox' value="Product3" name='cBox[]'/>
PHP Code:
<?php
if (isset($_POST['orderID']) && !empty($_POST['orderID'])) {
$orderID = $_POST['orderID'];
if (isset($_POST['cBox']) && !empty($_POST['cBox'])) {
foreach ($_POST['cBox'] as $productID) {
// SQL to insert $orderID and $productID into database
}
}
}
?>