title: PHP Form with java add
body: <p>I have a PHP page where the form can add multiple lines. However I am stuck at how to submit the form with all the line included in the submit. I am trying to build a system to add and remove stock.</p>
  
  <p><img src="https://i.stack.imgur.com/ZaOYK.png" alt="Form Picture"></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  
  require_once("../models/config.php");
  
  if (!securePage(__FILE__)) {
      // Forward to index page
      addAlert("danger", "Whoops, looks like you don't have permission to view that page.");
      header("Location: 404.php");
      exit();
  }
  
  setReferralPage(getAbsoluteDocumentPath(__FILE__));
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
          &lt;meta name="description" content=""&gt;
          &lt;meta name="author" content=""&gt;
  
          &lt;title&gt;Add Stock&lt;/title&gt;
  
          &lt;?php require_once("includes.php"); ?&gt;
  
      &lt;/head&gt;
  
      &lt;body&gt;
  
          &lt;div id="wrapper"&gt;
  
              &lt;!-- Sidebar --&gt;
              &lt;nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"&gt;
              &lt;/nav&gt;
  
              &lt;div id="page-wrapper"&gt;
                  &lt;div class="row"&gt;
                      &lt;div id='display-alerts' class="col-lg-12"&gt;
  
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-lg-12"&gt;
                          &lt;h1&gt;Dashboard &lt;small&gt;Add Stock&lt;/small&gt;&lt;/h1&gt;
                          &lt;ol class="breadcrumb"&gt;
                              &lt;li class="active"&gt;&lt;i class="fa fa-plus-circle"&gt;&lt;/i&gt; Add Stock&lt;/li&gt;
                          &lt;/ol&gt;
  
                      &lt;/div&gt;
                  &lt;/div&gt;&lt;!-- /.row --&gt;
  
                  &lt;div class="row"&gt;
                      &lt;div class="col-lg-12"&gt;
                          &lt;div class="panel panel-primary"&gt;
                              &lt;div class="panel-heading"&gt;
                                  &lt;h3 class="panel-title"&gt;&lt;i class="fa fa-ambulance"&gt;&lt;/i&gt; Units &lt;/h3&gt;
                              &lt;/div&gt;
                              &lt;div class="panel-body"&gt;
                                  &lt;form&gt;
                                      &lt;div class="row"&gt;
                                          &lt;div class="form-group col-lg-4"&gt;
                                              &lt;label&gt;Date&lt;/label&gt;
                                              &lt;input class="form-control" type="date"  id="date" &gt;
                                          &lt;/div&gt;
  
                                      &lt;div class="form-group col-lg-4"&gt;
                                          &lt;label&gt;Station&lt;/label&gt;
                                            &lt;select class="form-control" id="station" name="position"&gt;
                                                      &lt;option value="0"&gt; Please Select &lt;/option&gt;
                                                      &lt;?php
                                                      include 'connection.php';
                                                      $supplies= "SELECT * FROM `stations` ORDER BY station";
                                                      $result_supplies= mysql_query($supplies);
                                                      while($row_supplies = mysql_fetch_array($result_supplies)){
                                                      ?&gt;
                                                      &lt;option value="&lt;?php echo $row_supplies['id']?&gt;"&gt;&lt;?php echo $row_supplies['station']?&gt;&lt;/option&gt;
                                                      &lt;?php } ?&gt;
                                                  &lt;/select&gt;
                                      &lt;/div&gt;
                                      &lt;div class="form-group col-lg-4"&gt;
  
                                          &lt;input class="form-control" type="hidden" id="requester" value=""&gt;
                                      &lt;/div&gt;
                                      &lt;/div&gt;
                                      &lt;div class="row"&gt;
                                      &lt;div class="form-group col-lg-1"&gt;
                                          &lt;label&gt;Add Row&lt;/label&gt;
                                          &lt;input type="button" id="add-row" name="add-row" class="btn btn-success" value="+" /&gt;
                                      &lt;/div&gt;
  
                                  &lt;/div&gt;
                                  &lt;div class="row" id="clone-row"&gt;
                                      &lt;div class="row timesheet-row"&gt;
  
                                              &lt;div class="form-group col-lg-6"&gt;
                                                  &lt;label&gt;Item&lt;/label&gt;
                                                  &lt;select class="form-control" id="position" name="position"&gt;
                                                      &lt;option value="0"&gt; Please Select &lt;/option&gt;
                                                      &lt;?php
                                                      include 'connection.php';
                                                      $supplies= "SELECT * FROM `supplies` ORDER BY name";
                                                      $result_supplies= mysql_query($supplies);
                                                      while($row_supplies = mysql_fetch_array($result_supplies)){
                                                      ?&gt;
                                                      &lt;option value="&lt;?php echo $row_supplies['id']?&gt;"&gt;&lt;?php echo $row_supplies['name']?&gt;&lt;/option&gt;
                                                      &lt;?php } ?&gt;
                                                  &lt;/select&gt;
                                              &lt;/div&gt;
                                              &lt;div class="form-group col-lg-3"&gt;
                                                  &lt;label&gt;Total Removed&lt;/label&gt;
                                                  &lt;input class="form-control" type="number"&gt;
                                              &lt;/div&gt;
  
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;script src="../js/schedule.js"&gt;&lt;/script&gt;
                                  &lt;/form&gt;
  
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;&lt;!-- /.row --&gt;
  
              &lt;/div&gt;&lt;!-- /#page-wrapper --&gt;
  
          &lt;/div&gt;&lt;!-- /#wrapper --&gt;
  
          &lt;script&gt;
              $(document).ready(function () {
                  alertWidget('display-alerts');
  
                  // Load the header
                  $('.navbar').load('header.php', function () {
                      $('.navitem-dashboard').addClass('active');
                  });
              });
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>