title: How to fix the broken images even though I create the code that retrieves all images from the folder
body: <p>I've got the broken images when I try to retrieve all jpg files from the folder where the name is 'imgProduct'.</p>
  
  <p>The error message is 'Failed to load resource: the server responded with a status of 404 (Not Found)'</p>
  
  <p>The directory of all images is C:\Sungsan\imgProduct. </p>
  
  <p>And the directory of code below is C:\Sungsan\Website\view\shopPanel.php. </p>
  
  <pre><code>&lt;?php
  $productImg = glob("../imgProduct/*.jpg*");
  echo var_dump($productImg).'&lt;br&gt;';
  
  for($a = 0; $a &lt; count($productImg); $a++) {
   $num = $productImg[$a];
   echo basename($num)."&lt;br /&gt;";
   echo '&lt;img src="' .$num. '" alt="random image"&gt; &lt;br /&gt;';
  }
  ?&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mu4DP.png" rel="nofollow noreferrer">This image is the result that code above is excuted.</a></p>
  
  <p>I was searching for how to troubleshoot this broken images but I have no idea. Hope to give recommendation or suggestion. Thanks</p>