我有一个包含多行复选框的表单,每个复选框都有一个特定的 id,这些复选框正在使用foreach
循环显示。
你如何$_POST
从类似的东西中获取信息?我认为它就像这样$_POST[][]
,就像一个子数组,但我不知道如何设置它:
foreach($stakholderArray as $currentEntry) {
print "<tr class='$bgcolor'>";
print "<td class='left'>$currentEntry[org]</td>";
if($currentEntry['dataFound']) {
//if data was found for current stakeholder, display it
print ($currentEntry['Partner']) ? '<td><input type ="checkbox" checked ="checked" /></td>' : '<td><input type ="checkbox" /></td>';
print ($currentEntry['Agreement']) ? '<td><input type ="checkbox" checked ="checked" /></td>' : '<td><input type ="checkbox" /></td>';
print ($currentEntry['Train']) ? '<td><input type ="checkbox" checked ="checked" /></td>' : '<td><input type ="checkbox" /></td>';
print ($currentEntry['Meet']) ? '<td><input type ="checkbox" checked ="checked" /></td>' : '<td><input type ="checkbox" /></td>';
}
else { //else...no stakeholder data, display empty columns
print "<td><input type ='checkbox'/></td><td><input type ='checkbox'/></td><td><input type ='checkbox'/></td><td><input type ='checkbox'/></td><td><input type ='checkbox'/></td>";
print "</tr>";
}## Heading ##