dmarket
01-27-2010, 03:05 PM
Hello,
I am trying to make an online sandwich order form. So I have different lunch meats, bread, condiments and so on in mysql database. Everything I created is drop down box, however I have the condiments listed as checkboxes that are dynamically driven by another table. Here is the code for the checkboxes. When the user hits submit it shows on the users screen what they ordered for a sandwich and sends an email to our deli. Everything works except the condiments - as I do not know how to capture the value into a php variable. Should I use an array to do this sense the number of condiments could increase or decrease? Here is the code for selecting the condiments.
[CODE]
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"><strong>Condiments</strong><br>
<table width="399" cellpadding="0" cellspacing="0">
<?php do { ?>
<tr>
<td width="180" align="right" valign="middle" bgcolor="#FFFFFF"><?php echo $row_condiment['condiment']; ?>
<input name="c1" type="checkbox" id="c5" value="<?php echo $row_condiment['condiment']; ?>" /></td>
<td width="20" align="left"> </td>
<?php $row_condiment = mysql_fetch_assoc($condiment) ?>
<td width="180" align="left" valign="middle" bgcolor="#FFFFFF"><input name="c2" type="checkbox" id="c4" value="<?php echo $row_condiment['condiment']; ?>" />
<?php echo $row_condiment['condiment']; ?></td>
</tr>
<?php } while ($row_condiment = mysql_fetch_assoc($condiment)); ?>
</table>
[ICODE]
Hope this makes sense - sorry I am a newb still haha.
Thank you,
Dale
I am trying to make an online sandwich order form. So I have different lunch meats, bread, condiments and so on in mysql database. Everything I created is drop down box, however I have the condiments listed as checkboxes that are dynamically driven by another table. Here is the code for the checkboxes. When the user hits submit it shows on the users screen what they ordered for a sandwich and sends an email to our deli. Everything works except the condiments - as I do not know how to capture the value into a php variable. Should I use an array to do this sense the number of condiments could increase or decrease? Here is the code for selecting the condiments.
[CODE]
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"><strong>Condiments</strong><br>
<table width="399" cellpadding="0" cellspacing="0">
<?php do { ?>
<tr>
<td width="180" align="right" valign="middle" bgcolor="#FFFFFF"><?php echo $row_condiment['condiment']; ?>
<input name="c1" type="checkbox" id="c5" value="<?php echo $row_condiment['condiment']; ?>" /></td>
<td width="20" align="left"> </td>
<?php $row_condiment = mysql_fetch_assoc($condiment) ?>
<td width="180" align="left" valign="middle" bgcolor="#FFFFFF"><input name="c2" type="checkbox" id="c4" value="<?php echo $row_condiment['condiment']; ?>" />
<?php echo $row_condiment['condiment']; ?></td>
</tr>
<?php } while ($row_condiment = mysql_fetch_assoc($condiment)); ?>
</table>
[ICODE]
Hope this makes sense - sorry I am a newb still haha.
Thank you,
Dale