Bir yayınlanmıştır diziden tüm form değerleri Çekme

0 Cevap

Ben bu formu var:

<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>

Ben yazı almak ve herhangi bir fikirleri (bu sadece son sonuca dönmek görünüyor) aşağıdaki gibi ... onun meterage ile ortak ürün değerini yazdırmak çalışıyorum?

    $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/>";
   }

0 Cevap