title: PHP - List of Excel files to download from Intranet Site?
body: <p>I have a intranet site running PHP 5 that needs to list a folder containing only Excel files.</p>
  
  <p>Ideally the user needs to be able to input some search criteria (ie date) and the files would be filtered into a list of hyperlinks.  These hyperlinks could then be selected to download the excel file.</p>
  
  <p>What I have so far is:</p>
  
  <pre><code>//get search parameters (from a form)
  $s_Date = $_GET['s_Date'];
  $s_Shift = $_GET['s_Shift'];
  $s_Name = $_GET['s_Name'];
  
  //search folder
  foreach(glob("c:\folderA\folderB\*".$s_Date."*".$s_Shift."*".$s_Name."*.*") as     $FileName)
  {
      echo basename($FileName);
      echo"&lt;a href=?myad=".basename($FileName)."/&gt;Download&lt;/a&gt;"."&lt;br /&gt;";
  }
  </code></pre>
  
  <p>This returns list of files but selecting hyperlinks doesn't prompt for download.</p>
  
  <p>How do I get the hyperlink to force a content-type of msexcel?</p>