title: php specify folder from select option
body: <p>Sorry I am new to PHP. I want to create a form for getting the destination of a page that is being created as filename &amp; foldername.</p>
  
  <p>What I've done so far:</p>
  
  <pre><code>&lt;form method="post"&gt;
      &lt;input type='text' name='filename' placeholder='Enter a filename' /&gt;
      &lt;select&gt;
          &lt;option&gt; value='Folder1' name="thisfolder"&gt;Folder1&lt;/option&gt;
          &lt;option&gt; value='Folder2' name="thisfolder"&gt;Folder2&lt;/option&gt;
          &lt;option&gt; value='Folder3' name="thisfolder"&gt;Folder3&lt;/option&gt;
      &lt;/select&gt;
      &lt;input type='submit' value='Run the Script' /&gt;
  &lt;/form&gt;
  
  &lt;?php
      if ($_SERVER["REQUEST_METHOD"] == "POST"){ 
          $filename=$_POST['filename'];
          $myFile = .$thisfolder. "/page" .$filename.".php";
  
          $fh = fopen($myFile, 'w');
          $stringData = "Hello";
          fwrite($fh, $stringData);
      } 
  ?&gt;
  </code></pre>
  
  <p>As you've noticed first <code>input</code> is used to get the target page's filename &amp; the <code>select</code> element is used to choose one of the three predefined folders as the storage directory destination.</p>
  
  <p>Any help would be appreciated.</p>