title: PHP dynamic form input into a new html page form on submit
body: <p>I am having some difficulty with inserting dynamic input fields into a new form html page. Essentially, I would like to get these dynamically created inputs into a new form field when the submit button is clicked on the previous page where the table dimensions are specified. Currently, when I view the page source, the input fields are outside of the html body. I would prefer not to have to use JavaScript just the keep things simple</p>
  
  <p>//page where dimensions are specified e.g dimensions.html. clicking submit should bring you to a new page and display specified inputfields inside the html form. </p>
  
  <pre><code>&lt;form action="script.php" method="post"&gt;          
  
      &lt;label for="rows"&gt;Number of Rows (Min 1, Max 10)&lt;/label&gt;
      &lt;input type="number" class="form-control" min="1" max="10"  value="" name="rows" required&gt;
  
      &lt;label for="columns"&gt;Number of Columns (Min 3, Max 10)&lt;/label&gt;
      &lt;input type="number" class="form-control" min="3" max="10" value="" name="columns" required&gt;
  
      &lt;input type="submit" name="submit2" value="Submit"/&gt;
  
      &lt;input type="hidden" name="method" value="post" /&gt; 
  
  
  &lt;/form&gt;
  
       // loop for creating input fields from previous form input specifying table dimensions from seperate .php file
  
           $row = (isset($_POST['rows']) ? $_POST['rows'] : null);
           $col = (isset($_POST['columns']) ? $_POST['columns'] : null);
           $x = $row * $col;
  
           for ($i = 1; $i &lt;= $x; $i++) {
               echo "$i&lt;input type='text' name='content[]' required&gt;",  "&lt;br&gt;";
           }
  </code></pre>
  
  <p>// new html page form page e.g. content.html</p>
  
  <pre><code>&lt;form action="script.php" method="post"&gt;
          &lt;input type="text" name="content[]"&gt; 
  </code></pre>
  
  <p>// I would like to have the new fields input generated inside here</p>
  
  <pre><code>        &lt;input type="submit" name="submit3" value="Submit"/&gt;
          &lt;input type="hidden" name="method" value="post"/&gt;
  &lt;/form&gt;
  </code></pre>