Forum Moderators: coopster
This is a rookie question, sorry
I am trying to create a web page in which it has a gallery. I am using a array in php to read the image directory. I can display the file nakes from the directory out not the actual images. The code I am using is below, Can I do it this way?
$dir = 'Gallery';
$files = scandir($dir);
foreach($files as $image)
{
if (substr($image, 0, 1)!= '.')
{
$image_size = getimagesize ("$dir/$image");
$file_size = round ( (filesize("$dir/$image")) /1024). "kb";
?>
<ul id="albumlist">
<?php
echo "<li><img src='/gallery/$image'/>$image, $file_size</li>";
}
}
?>
I have changed the case the G, it doen't matter.
the code shown on IE is:
img src='/Gallery/Hut.JPG'/>Hut.JPG, 655kb
whicj ios correct, all the page is shpwing is a small square with a red cross and the file name and file sixe, so it is working as in so far that the file names is changinf but the picture doesnt show,