title: Showing specific image from folder
body: <p>I'm trying to insert a specific image from a folder on to my <code>products</code>. But with the code I have now, it displays all the images from the folder on all the products. How do I only show 1 specific image per product?</p>
  
  <pre><code>$dir = "pictures/productimg/";
  if ($opendir = opendir($dir)) {
      while (($file = readdir($opendir)) !== false) {
          if ($file != "." &amp;&amp; $file != "..") {
              echo "&lt;div class='productimg'&gt;";
              echo "&lt;img src='$dir/$file'/&gt;";
              echo "&lt;/div&gt;";
          }
      }
  }
  </code></pre>