I am trying to display all images located in two sub-folders. Both sub-folders are located in one folder.
Here is the code I have right now
$columncount = 0;
$dynamicList = '<table width="744" border="0" cellpadding="6"><tr>';
while($row = sqlsrv_fetch_array($stmt)){
$id = $row["productID"];
$product_name = $row["product_name"];
$product_price = $row["product_price"];
$dynamicList .= '<td width="135"><a href="product_details.php?productID=' . $id . '"><img src="images/products/Men/' . $id . '.jpg" alt="' . $product_name . '" width="129" height="169" border="0"></a></td>
<td width="593" valign="top">' . $product_name . '<br>
£' . $product_price . '<br>
<a href="product_details.php?productID=' . $id . '">View Product Details</a></td>';
if($columncount == 2){
$dynamicList .= '</tr><tr>';
$columncount = 0;
}else
$columncount++;
}
$dynamicList .= '</tr></table>';
echo $dynamicList;
As you can see I get all images from "products/Men/". But my products folder also contains a sub-folder named Women.
How can I display all images from both Men and Women sub-folders located in products folder
I tried displaying products like this:
<img src="images/products/
But that doesn't work at all. How can I get to display all images from both sub-folders in PHP?