title: How do I finish code for search form that displays files in a folder?
body: <p>I am wanting a search form that searches and displays files in a folder. I have found the reference php code below (which I am completely unfamiliar with):</p>
  
  <pre><code>&lt;?php
  $dir = "/Users/rosaliaobrien/Desktop/Bio_pages/HTML_files/South";
  
  // Open a known directory, and proceed to read its contents
  if (is_dir($dir)) {
  if ($dh = opendir($dir)) {
      while (($file = readdir($dh)) !== false) {
          if($file == $_???['_???']){
              echo('&lt;a href="'.$dir . $file.'"&gt;'. $file .'&lt;/a&gt;'."\n");
          }
      }
      closedir($dh);
  }
  }
  ?&gt;
  </code></pre>
  
  <p>I am not sure what to plug in for the two spaces labeled '_???'. Here is the html code for the search bar:</p>
  
  <pre><code>&lt;form class="searchbar" action="//Desktop/fields/html\ codes/searchresults.php" style="max-width:300px"&gt;
  &lt;input type="text" placeholder="Search.." name="search2"&gt;
  &lt;button type="submit"&gt;&lt;i class="fa fa-search"&gt;&lt;/i&gt;&lt;/button&gt;
  </code></pre>