I have an order form and the products are in checkboxes. The selected items should be inserted to a database column. I'm not very good in coding yet so it would be great if you showed me an example. Thank you.
Here's my table:
<form name="form" method="POST">
<table width="623" height="283" border="0" align="center">
<tr>
<td width="146">Name:</td>
<td width="266"><label for="name"></label>
<input type="text" name="name" id="name" /></td>
</tr>
<tr>
<td>Contact No:</td>
<td><label for="contactno"></label>
<input type="text" name="contactno" id="contactno" /></td>
</tr>
<tr>
<td>Address:</td>
<td><label for="address"></label>
<input type="text" name="address" id="address" /></td>
</tr>
<tr>
<td height="31">Select Items:</td>
<td>
<label>
<input type="checkbox" name="CheckboxGroup[]" value="sample one" id="CheckboxGroup_0" />
Checkbox</label>
<br />
<label>
<input type="checkbox" name="CheckboxGroup[]" value="sample two" id="CheckboxGroup_1" />
Sample</label>
<br />
<br />
</p></td>
</tr>
<tr>
<td>Payment Option:</td>
<td>
<label for="pay_option"></label>
<select name="pay_option" id="pay_option">
<option value="Counter">Counter</option>
<option value="BDO">BDO</option>
<option value="Smart Money">Smart Money</option>
</select>
</td>
</tr>
<tr>
<td>Claiming Option:</td>
<td>
<label for="claim_option"></label>
<select name="claim_option" id="claim_option">
<option value="Pick-up">Pick-up</option>
<option value="Shipping">Shipping</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="button" id="button" value="Submit" /></td>
</tr>
</table>
</form>
Basically, whatever the user selects, should be inserted to a db column upon clicking the submit button. I don't know the PHP script for it.I use dreamweaver and mysql workbench
Aucun commentaire:
Enregistrer un commentaire