title: Populating and creating two dropdown list from array using PHP
body: <p>I am encountering a strange problem when trying to create two dropdowns where the values are loaded from two different arrays. The problem is I can see only one dropdown and at the end of the list I see the label of the next dropdown, finally it is also not showing any submit button which I have created after the dropdown lists. </p>
  
  <p>Let me make it clear with some code and screenshots, so that one can have an idea:</p>
  
  <pre><code>if($output_form == 1){
      ?&gt;
  
          &lt;form action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" method="post"&gt; 
          &lt;label&gt;ID&lt;/label&gt;
              &lt;input type="text" name="ID" /&gt;&lt;br /&gt;&lt;br/&gt;
          &lt;label&gt;Name&lt;/label&gt;
              &lt;input type="text" name="name" /&gt;&lt;br /&gt;&lt;br/&gt;
          &lt;label&gt;Upload1:&lt;/label&gt;
              &lt;input type="file"  name="upload1" /&gt;&lt;br /&gt;  
          &lt;label&gt;Upload2:&lt;/label&gt;
              &lt;input type="file"  name="upload2" /&gt;&lt;br /&gt;               
  
          &lt;label&gt;Catalogue&lt;/label&gt;
          &lt;select name="cataloguepdfs" /&gt;
          &lt;?php        
              foreach ($catalogueArray as $cataloguePDFName) {    
                  echo '&lt;option value="'. $cataloguePDFName . '"&gt;' . $cataloguePDFName . '&lt;option /&gt;';                     
              }                                       
          ?&gt;  
          &lt;label&gt;Template&lt;/label&gt;
          &lt;select name="templatepdfs" /&gt;
          &lt;?php
              foreach ($templateArray as $templatePDFName) {    
                  echo '&lt;option value="'. $templatePDFName . '"&gt;' . $templatePDFName . '&lt;option /&gt;';                     
              }
          ?&gt;       
          &lt;input type="submit" name="submit" value="Submit"&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  &lt;?php
      }
  ?&gt;   
  </code></pre>
  
  <p>Here is the screenshot for the above code. Please note that the rest of my code is working good, fetching the .pdf file names from the respective arrays. Please note that my pdfs are named 1.pdf, 2.pdf and so on</p>
  
  <p><img src="https://i.stack.imgur.com/84rZl.png" alt="Image 1"></p>
  
  <p>On the other hand if I move the template dropdown list above the catalogue dropdown list it is the other way round with 'Catalogue' as the end element in the dropdown list.</p>
  
  <p>If there is only dropdown list everything works fine including the presence of the submit button.</p>
  
  <p>Is there a way how I can display both the dropdowns after populating them from respective arrays. Is there some problem with my code. Any help would be appreciated.</p>
  
  <p>Thanks</p>