posting rows of html table seperately to php
<p>I'm trying to store contents a tr in table #itemsTable,  in array celValues and post it to php and repeat it (post next tr until last tr).
here is code:</p>

<pre><code>$('#save').click(function(){
    //alert("hi");
    var celValues= new Array();
    $('#itemsTable tr').each(function() {
           celValues[0] = $('td:nth-child(2)').find('input').val();
           celValues[1] = $('td:nth-child(3)').find('input').val();
           celValues[2] = $('td:nth-child(4)').find('input').val();
           celValues[3] = $('td:nth-child(5)').find('input').val();
           celValues[4] = $('td:nth-child(6)').find('input').val();

           $.post("test.php", {celvalues: celValues},function(data){

                 document.write(data);

           });

    }); 

});
</code></pre>

<p>test.php:</p>

<pre><code>&lt;?php
  $i=0;
  $arr= array();
  $arr = $_POST['celvalues'];
  foreach($arr as $val)
         {
             echo " " .$arr[$i];
             $i++; 
         }
?&gt; 
</code></pre>

<p>problem is it repeats first row instead of posting contents of all tr.</p>

<p>output for 3 row with differnt contents.but first row repeated 3 times:</p>

<p>1000 Website Design 1 100.5 100.5 1000Website Design1100.5100.5 1000 Website Design 1 100.5 100.5</p>
