|
Posted by John Ellingsworth on 08/25/05 16:38
Martin
You can use this, modified to fit your specific needs:
<?
// THE NAME OF YOUR IMAGEFILE
$imagefile = "bla.jpg";
//PATH WHERE THE IMAGES ARE STORED ON OUR WEB SERVER
$path = "/home/user/website.come/themes/default/images/" . $imagefile;
//TELL THE BROWSER WE ARE SENDING AN IMAGE
header("Content-type: image/jpeg");
//OPEN THE IMAGEFILE
$jpeg = fopen($path,"r");
//READ THE IMAGEFILE
$image = fread($jpeg,filesize($path));
//SEND IT DOWN THE PIPE
echo $image;
?>
Call this image.php
Call it in a webpage using this:
img src=image.php
Of course, you will need to figure out how to specify which image you
want loaded as $imagefile - be it a database, random selection, etc.
--
Thanks,
John Ellingsworth
Project Leader
Virtual Curriculum
Academic Programs
(215) 573-4451
Virtual Curriculum
http://www.cu2000.med.upenn.edu
AIM: vc2000support
To contact the Virtual Curriculum team:
cu2000@mail.med.upenn.edu
Martin Zvarík wrote:
> Hi,
> I have a website, which uses themes.
>
> The web tree looks like this:
>
> * webroot
> o *themes*
> + default
> # images
> + red design
> # images
> o *index.php*
>
>
> Let's say I choose "red design" theme. All the pictures the theme is
> using will have URL like "www.site.com/themes/default/images/bla.jpg".
>
> Is there a way how I can change it? So noone can see I have themes in
> that directory?
>
> I was thinking about: ShowImage.php?blah.jpg, but that is too slow... :-/
>
>
> Any help appreciated.
>
> Martin
>
>
Navigation:
[Reply to this message]
|