title: Adding or deleting automatically rows in a form, processed with PHP
body: <p>I'm using the script below to automatically add new lines in a form, but I do not see how to retrieve the values ​​of each field under PHP with $_POST.
  If someone has already had this problem with a table in a form, thank you for helping me!
  what procedure to retrieve in test5.php the values ​​of the fields.
  I do not know how to get an array in a $_POST</p>
  
  <p>thank you in advance</p>
  
  <p>Here is my script</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;form action="test5.php" method="post"&gt;
          &lt;div id="address"&gt;
              &lt;div id="1" name="address[]"&gt;
                  &lt;input id="mail" type="text" /&gt;
                  &lt;input id="type" type="text" /&gt;
                  &lt;input id="comment" type="text" /&gt;
                  &lt;a href="#" class="removeclass" style="display:none;"&gt;&amp;times;&lt;/a&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;input id="add_address" type="button" value="Ajouter" /&gt;
          &lt;input type="submit" value="Create PDF" /&gt;
      &lt;/form&gt;
      &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          $('#add_address').click(function(event) {
              var lastDiv = $('#address &gt; div').last();
              var id = parseInt(lastDiv.attr("id")) + 1;
              (lastDiv.clone(true).attr("id", id)).insertAfter(lastDiv).find(".removeclass").show();
              return false;
          });
  
          $('body').on('click', '.removeclass', function(event) {
              $(this).parent().remove();
              return false;
          })
      &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>