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

Posted by Jerry Stuckle on 01/02/06 05:34

Chung Leong wrote:
> Well, if the images aren't within the webroot, then the web server
> won't serve them...
>

Not true. You can serve them through PHP, e.g.

<img src="showimg.php"...>

And showimg.php can be something like:

header('Content-type: image/gif');
header('Content-length: '.filesize($img_filename));
$file_pointer = fopen('/some/other/directory/img.gif', 'rb');
fpassthru($file_pointer);
fclose($file_pointer);

The graphic can reside anywhere on the system which is accessible to the
Apache process (not just under DocumentRoot).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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