我有一個窗體,其中有多行復選框,每個複選框都有一個特定的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 ##
輸入名稱可以是一個變量數組嗎?像我仍然無法讓它工作..這是一個截圖,如果它有幫助https://plus.google.com/u/0/photos/102528100285286815171/相冊/ 5708634782606194689/5708634785261526130 – user718229 2012-02-13 15:03:11