I am starting out on a script to try and pull jpegs from a thumbnail directory and display them on a page. I have used some code from the php manual here to get me started but I don't think the script is able to access the directory from what I've coded. All the images are in a subfolder called "images" and the thumbnails in a subfolder called "thumbnails".
I get the following error when I try to run the page.
Code: Select all
Warning: opendir(/images): failed to open dir: Invalid argument in G:\ApacheServer\PrintedVisions_August2004\Testing\clients\testclient\TMP8oiu63fzc6.php on line 15if ($handle = opendir("/" . $image_path)) {
Code: Select all
<?php
$image_path = "images";
$thumbnail_path = "thumbnails";
$extentions = array('jpg', 'jpeg', 'JPG', 'JPEG');
if ($handle = opendir("/" . $image_path)) {
echo "Directory handle: $handle\n";
echo "Files:\n";
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) {
echo "$file\n";
}
closedir($handle);
}
?>Thanks.
Brad.