I have recently been developing a small site for a local folk artist. During developing this, I decided that to make it nice and easy to upload photos (and because for this job it is too much to create a complete CMS for the picture gallery) I would just create a little script that read a directory, and populated the gallery according to the subsequent directories and images it hit.
I wrote this, and it works fine here:
chriskingnet.com
However, when I came to switch over to my clients server, I ran into a bug - which as of yet I just can't figure out!
Bugged site:
hickmanandcassidy.co.uk
I have run phpinfo() on each server.
chriskingnet.com HERE.
hickmanandcassidy.co.uk HERE.
It is a little older than the first, but I'm not sure if that would be the problem (although personally I'm not sure what else it would be - I've made sure all my directories match etc).
Here is the code I am running to populate the galleries:
<?php
#loop through all directories, use their name to create links, headers and import thumbs
$count = 0;
$handle = opendir('./imgs/gallery/');
while (false !== ($file = readdir($handle)))
{
if ($count > 1) {
echo "<div class='gallery_entry'>";
echo "<div class='gallery_header'>" . $file . "</div>";
echo "<div class='gallery_thumb'>";
echo "<a href='igallery.php?gallery_name=" . $file . "'>";
echo "<img class='gallery' src='./imgs/gallery/" . $file . "/thumb.png' alt='" . $file . " Thumb' width=148 height=116 />";
echo "</a>";
echo "</div>";
echo "</div>";
} else {
#file is not valid, don't process it
#first two are not counted, skip them and increment count
$count++;
}
}
?>
I would appreciate any help on this. It might well be that I'm missing something that's right in front of me! Or it might be that I do need to get that update done on the my client's server - just didn't want to do it without definite need to!
(Have attached the .php files including the full html)


Sign In
Create Account



Back to top









