You are here: Re: Displaying Images form a Directory « PHP Programming Language « IT news, forums, messages
Re: Displaying Images form a Directory

Posted by Jameson on 01/03/06 00:14

Hi Jim:

Thanks for the suggestion. I tried it out, but still got a blank
screen. I think Chung might be right, because if I try "<img
src="/Library/WebServer/Documents/uploads/door.jpg>" the web server
won't serve them. I think the client's browser is trying to find the
images locally on the HD.

Maybe what I'm trying to do isn't possible. Do you think using the
glob() function within the opendir() function might work?

Thanks for all of the help!

Jim Carlock wrote:
> "Jameson" <jameson_ray@comcast.net> wrote:
> > 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:
>
> Use witkey's suggestion with a modification?
>
> <?php
> // An Example about listing Images.
> $dir = ".";
> $odir = opendir($dir);
> while($file = readdir($odir)){
> if(filetype($file) == "image/JPEG") {
> $sAltText = '"Whatever the alt text is if so required."';
> echo '<img src="' . $dir . $file . ' border="0" alt="' . $sAltText . '" /><br />' . "\n";
> }
> ?>
>
> Jim Carlock
> Post replies to the newsgroup.

 

Navigation:

[Reply to this 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

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