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

Posted by feo on 10/06/02 11:36

header ( 'Content-Type: ' . image_type_to_mime_type ( $img ) );
readfile ( $img );

$img is the relative path to the image file. Let's say you use this tree:

/directory_for_everything
/directory_for_everything/directoryforstoringimages
/directory_for_everything/directoryhttpexposed

If your script is stored in the last directory, then $img =
'../directoryforstoringimages/nameofimage';

Hope it helps.

feo

"Jameson" <jameson_ray@comcast.net> escribiσ en el mensaje
news:1136134747.652428.106160@g44g2000cwa.googlegroups.com...
> Happy New Year, Everyone!
>
> I am trying to figure out how to display a bunch of images (mainly
> JPEGs, but possibly a few GIFs and PNGs as well) that are stored in a
> local directory on the system. I can do this with the glob() function,
> but I can't seem to put in a directory other than one within the
> webroot. For example, I can only put "/uploads" and not
> "/Volumes/jray/Pictures...".
>
> Any ideas how to get around this? If I can't use the glob function,
> it's fine, but I only want images to be displayed (and not any other
> file that happpens to be stored in that directory).
>
> Thanks in advance!
>

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация