Reply to Re: Displaying Images form a Directory

Your name:

Reply:


Posted by Jameson on 01/02/06 02:53

Thanks for the fast response. What I'm trying to do is actually display
the images, not list them. What I've got so far (sorry for not posting
this earlier) is:

<?php
echo "<table><tr>";

foreach(glob("uploads/*.{jpg,JPG,jpeg,JPEG,gif,GIF,png,PNG}",
GLOB_BRACE) as $images)
{
echo "<td><img src=\"".$images."\"><br/>";
}

echo "</tr></table>";
?>

It works just fine if I want to view images in the "uploads/" folder
(which is parallel to this script), but if I want to change it to be
"/Volumes/jray/Pictures" it won't work.

witkey wrote:
> <?php
> // An Example about listing Images.
> $dir = ".";
> $odir = opendir($dir);
> while($file = readdir($odir)){
> if(filetype($file) == "image/JPEG") {
> echo $file;
> }
> ?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация