In my HTML code I have the following:
<label for="reference_1" class="labelCheckbox">
<input tabindex="20" type="checkbox" name="reference_1" id="refertype[]" class="inputCheckbox" value="Rose madder" />
Rose madder</label>
<label for="reference_2" class="labelCheckbox">
<input tabindex="22" type="checkbox" name="reference_2" id="refertype[]" class="inputCheckbox" value="Cerulean blue" />
Cerulean blue</label>
<label for="reference_3" class="labelCheckbox">
<input tabindex="24" type="checkbox" name="reference_3" id="refertype[]" class="inputCheckbox" value="Sap green" />
Sap green</label>
<label for="reference_4" class="labelCheckbox">
<input tabindex="26" type="checkbox" name="reference_4" id="refertype[]" class="inputCheckbox" value="Pompeii Red" />
Pompeii Red</label>
<label for="reference_5" class="labelCheckbox">
<input tabindex="28" type="checkbox" name="reference_5" id="refertype[]" class="inputCheckbox" value="Pyrrol Crimson" />
Pyrrol Crimson</label>
<label for="reference_6" class="labelCheckbox">
<input tabindex="30" type="checkbox" name="reference_6" id="refertype[]" class="inputCheckbox" value="Venetian red" />
Venetian red</label>
</fieldset>
And in my PHP processing script page I access the array this way:
<?php
$refertype = implode(',', $_POST['refertype']);
?>
But I always receive an error for that line of code unless I comment it out -
Warning: implode() [function.implode]: Invalid arguments passed in /home/content/56/8666756/html/_test/forms/scripts/php/process-ifpp-form.php on line 48
Changing the name of the ‘refertype’ variable makes no difference. I even have some other checkbox arrays set up in exactly the same manner, and they all work. So what am I doing wrong here?