The script that I’m trying to run is straight forward, at least think it’s straight forward. I got the script from this site - http://www.brightcherry.co.uk/scribbles/php-list-all-files-in-a-directory/ ,(sorry I can’t post links yet), when searching on how to list file names from a server directory. I found quite a few places on the subject and all seemed a bit overly complicated compared to the one in the link above. the script is as follows :
[php]
//path to directory to scan
$directory = “EXAMPLE_IMAGES_PATH”;
//get all image files with a .jpg extension.
$images = glob($directory . “*.jpg”);
//print each file name
foreach($images as $image)
{
echo $image;
}
[/php]
I’ve attempted other variations of the echo like this :
[php]
echo “”;
echo “”;
echo “<img src=/”/";echo $image;echo “/”//>"
echo “”;
[/php]
The final html output for each should look like this :
<img src="/path/to/image/*.jpg"/>
I’m not getting anything back. How can I make this work for me. I’m also going to be extending it to be a little more complicated. Something like this :
[php]
echo :$page->pagename";echo “/”; //This would be echoed after EXAMPLE_IMAGES_PATH
[/php]
The final html output would then be :
<img src="/path/to/image/pagename/*.jpg"/>
Any help on how to accomplish this in any variation would be of great help and great learning experience as well.