我有這樣的形式:從發佈的陣列中拔出所有表單值
<form method="post" action="mypage.php" orderform="" name="" id="orderform">
<a id="add">+</a>
<table width="533" cellspacing="0" cellpadding="2" border="0" id="ordertable">
<tbody>
<tr>
<td width="33%">Product Code (e.g 66203)</td>
<td width="33%">mtrs sq Required (e.g 10)</td>
<td width="33%">Preview Image</td>
</tr>
<tr class="item">
<td class="prodcode "><input type="text" id="prodcode[]" name="prodcode[]" class=" "></td>
<td class="meterage"><input type="text" id="meterage[]" name="meterage[]"></td>
<td class="imgsample"></td>
</tr>
<tr class="item">
<td class="prodcode "><input type="text" id="prodcode[]" name="prodcode[]" class=" "></td>
<td class="meterage"><input type="text" id="meterage[]" name="meterage[]"></td>
<td class="imgsample"></td>
</tr>
</tbody>
</table>
<button>Submit</button>
</form>
我試圖接受後並打印其計量收費的助理產品價值...如下(這似乎只返回最後的結果)有什麼想法?
$number_of_products=count($_POST['prodcode']);
for ($i=0; $i<$number_of_products; $i++){
$orderdetails = $_POST['prodcode'][$i]." has the meterage: ".$_POST['meterage'][$i]."<br/>";
}
謝謝,什麼旋鈕! :) – Andy 2010-11-29 19:24:15