title: Need to add a search to static HTML site
body: <p>Basically I've got an old static html site ( <a href="http://www.brownwatson.co.uk/brochure/page1.html" rel="noreferrer">http://www.brownwatson.co.uk/brochure/page1.html</a> ) I need to add a search box to it to search a folder called /brochure within that folder is html documents and images etc I need the search to find ISBN numbers, Book Reference Numbers, Titles etc.. There's no database the hosting provider has got php I was trying to create something like this:</p>
  
  <pre><code>&lt;div id="contentsearch"&gt;
           &lt;form id="searchForm" name="searchForm" method="post" action="search.php"&gt;
             &lt;input name="search" type="text" value="search" maxlength="200" /&gt;
             &lt;input name="submit" type="submit" value="Search" /&gt;
             &lt;/form&gt;
           &lt;?php
  $dir = "/brochure/";
  
  // 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 == $_POST['search']){
              echo('&lt;a href="'.$dir . $file.'"&gt;'. $file .'&lt;/a&gt;'."\n");
          }
      }
      closedir($dh);
  }
  }
  ?&gt;
         &lt;/div&gt;
  </code></pre>
  
  <p>I know, I know this is pretty bad and doesn't work any ideas? I haven't created anything like this in years, and have pretty much just taken bits of code and stuck it together! </p>