Ok, here goes.. ive search through all the posts that seems to mentioned a similar thing but i cant find anything that works for me.
I have a form set for customers to request a brochure from one of our distributors. The form asks for a number of details, and we want to add the feature for them to select which brochure they want, rather than sending out all.
The code i am adding is as follows:
<p>Please select the brochure(s) you would like:<span>*</span></p>
<br>
<input type="checkbox" name="brochures[]" value="brochure 1"> brochure 1<br>
<input type="checkbox" name="brochures[]" value="brochure 2"> brochure 2<br>
<input type="checkbox" name="brochures[]" value="brochure 3">brochure 3<br>
<input type="checkbox" name="brochures[]" value="brochure 4" >brochure 4<br>
<input type="checkbox" name="brochures[]" value="brochure 5" >brochure 5<br>
<input type="checkbox" name="brochures[]" value="brochure 6" > brochure 6<br>
<input type="checkbox" name="brochures[]" value="brochure 7" > brochure 7<br>
Then following is to get that info and pass to the database...
<?php
if(isset($_POST['brochures'])){
$brochureList = implode(' ',$_POST['brochures']);
} else {
$brochureList = "no brochure selected";
}
?>
and of course to insert it into mySQL..
INSERT INTO ". THE_TABLE_NAME ." SET 'brochure'= $brochureList;
whenever i run a test, i fills the brochure column with 'no brochure selected', no matter if i tick one or all of the checkboxes.
Any help, or information that would point me in the right direction would be a massive help.
Ta