title: Check if PDF file with matching name exists, link to it
body: <p>I am working on a real estate website. We are drawing in real estate listings using MLS numbers and some of these listings have PDF brochures. I would like to check if a brochure exists for a listing - the PDF file is "mls#.pdf", with the MLS # matching the listing. If there is a PDF, I want to link to that. Otherwise the link should go to the MLS page for that listing.</p>
  
  <p>I have tried this code below, but I don't know how to set it to search for/link to the filename that matches the listing. (The second echo is clearly wrong too, I don't know how to go back and forth from php in that way).</p>
  
  <pre><code>&lt;?php
  $inc_file = "pdf/$MLS_ACCT.pdf";
  if (file_exists($inc_file)) {
  echo '&lt;a href="pdf/$MLS_ACCT.pdf"&gt;Click here for Brochure - Open PDF at 100%&lt;/a&gt;';}
  else {
  echo '&lt;a href="property-search-results.php?MLS_ACCT=&lt;?php echo $MLS_ACCT ;?&gt;" target="_top"&gt;Further Details &gt;&gt;&lt;/a&gt;'; }
  ?&gt;
  </code></pre>