Can anyone tell me why I only get the first letter of the image_name, when I run this code? It picks up the images but won't display them because I only get the first letter of the image name.
$handle=opendir($server_path);
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && @getimagesize("$server_path/$file")) {
$image['name'] = $file;
$images[] = $image;
}
}
unset($image);
closedir($handle);
if (!$images) {
print "<div align=\"center\" style=\"font-size: 18pt\">There are no images in this directory</div>";
} else {
$images = array_reverse($images);
for($x=0;$images[$x];$x++){
$image = $images[$x];
$image_name = $image['name'];
echo $image_name;
print "<a href=\"submitimages.php\"><img src=\"$www_path/$image_name\" border=\"0\"></a>";
}
}