Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Make an easy list of your photos by MBK

Code Wizard, 12-30-2006

Just put this script somewhere and edit the $path variable to the path where the photos/images are you want to list.
It searches the dir for files with the extension jpg, gif and bmp. You can add more if you want.
Then it sorts 'm, and lists 'm.

<?
$path = "/the/path/with/your/photos/" ;
$d = dir("$path");
$count = 0;
while($entry=$d->read()) {
$file = explode(".", "$entry");
$extens = end($file);
$extens = strtolower ($extens);

if ($extens == "jpg" OR $extens == "gif" OR $extens == "bmp") {
$file[$count] = $entry;
$count++;
}
}
sort($file);
reset($file);
for ($i = 0; $i < $count; $i++) {
echo "<a href='$path/$file[$i]'>$file[$i]</a><br>";
}
?>
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions