I have this code line:
<input lass="validate[minCheckbox[1]] checkbox" name="samplecheckbox <?=$row_Answer['QuestionIDFK']; ?> []" id="samplecheckbox <? = $row_Answer['QuestionIDFK']?>[]" value="<?= $row_Answer['AnswerIDPK']; ?>" type="checkbox" />
Where the checboxes’ names are something like samplechecbox14[],samplechebox21[]
What is the correct php syntax for call this element inside of a $_POST? . I was trying with :
foreach(... as $QuestionIDFK){
foreach($_POST['samplecheckbox.$QuestionIDFK.'] as $valueID){
// Intert on tables
}}
or
foreach(... as $QuestionIDFK){
foreach($_POST['samplecheckbox<?= $row_Answer['QuestionIDFK']?>'] as $valueID){
// Intert on tables
}}
but don’t works. I need call this in that way , i know other ways but i have use this because i need a common name per question (and multiple answers per question) . So what i should to write inside POST ?
Assuming that
$QuestionIDFKcontains the$row_Answer['QuestionIDFK']value you used when you built the form.