i got this php code that suppose to take the pictures from inside a directory and make a picture gallery, but for some reason the picture come out in wit the [X] in the middle no picture displays. can anyone tell me why? can it be the folder permission? heres the php code i am using:
Code: Select all
<?php
$dir="directory path";
$path=getcwd().'/'.$dir;
$handle=opendir($path);
$i=1;
$handle=opendir($path);
while ($file=readdir($handle)) {
if (strpos($file, '.jpg')) {
$images = "<img src=\"p/$file\" alt=\"pic$i\" border=\"0\" height=\"90px\" width=\"120px\" hspace=\"5px\" />";
echo $images;
$i++;
}
}
?>
