Well, you couldn't put an image outside the document root, and use a normal
HTML tag (<img src="image.gif">) obviously, because the browser wouldn't be
able
to read it...

but

you could do "<img src="fetchimage.php?image=image.gif">" and the program
fetchimage could go to a directory (not in your document root) and look for
the
image "image.gif". If it found it, it could pass back the appropriate
Content-Type
header (in this case image/gif), and then open the image as a file, and
start
spiting back the binary of the image to the browser.

something like this:

$file = "/path/to/images/$image";

$imagep = @fopen($file,"r");
    if ($imagep)

        header("Content-type: image/gif");
        while(!feof($imagep))

            $buffer = fread($imagep,4096);
            echo $buffer;
        }
        fclose($imagep);
    }

Something like that.

Good luck,

Mike
[EMAIL PROTECTED]

> Hi there,
>
>  is it possible to place data like images outside the server root, and if
so
> does php still get access to them for displaying?
>
>  thanx, Andy
>
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to