title: insert html code to a page via php script in other page
body: <p>i'm a little bit new for php so maybe this question is stupid.</p>
  
  <p>say i have a form:</p>
  
  <pre><code>&lt;form id="createNewGallery" name="newgallery" method="GET" action="code.php"&gt;&lt;p&gt;&lt;strong&gt;please choose the number of pictures you want to upload:
    &lt;/strong&gt;
    &lt;select name="numOfPictures" id="numOfPictures"&gt;
  
        &lt;option&gt;3&lt;/option&gt;
        &lt;option&gt;4&lt;/option&gt;
        &lt;option&gt;5&lt;/option&gt;
        &lt;option&gt;6&lt;/option&gt;
        &lt;option&gt;7&lt;/option&gt;
        &lt;option&gt;8&lt;/option&gt;
        &lt;option&gt;9&lt;/option&gt;
        &lt;option&gt;10&lt;/option&gt;
    &lt;/select&gt;&lt;/p&gt;
    &lt;input name="submitNumOfPictures" type="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>by submiting this form i want to add afterwards another form, i know i can do it in this particular page but i just want my code not to be messy, so i want to do it in another page, say code.php</p>
  
  <p>and this is the code:</p>
  
  <pre><code>&lt;?php
  
  if (isset($_GET['numOfPictures'])){
  
      $times = $_GET['numOfPictures'];
      for ($i = 1; $i &lt;= $times; $i++){
          echo '&lt;br /&gt;select picture number '.$i.': &lt;br /&gt;';
          echo '&lt;input name="file'.$i.'" type="file" /&gt;';
  
      }
      echo '&lt;/br&gt;&lt;input name="submitFiles" type="submit" /&gt;';
  
  }
  </code></pre>
  
  <p>the result im getting is an output in a new page, code.php, but i want it to create a form just afterwards the for i had on my index php.</p>
  
  <p>i get the required result if i do mt php coding in the index page.</p>