Hi People
That is a very good idea, i was thinking about using something similar on a
file sharing area...
But James, do you know how can we use this to build pages
i mean include images on a html pages on a restricted way
kind like
image=/somewhere/mysecretfile.jpg
Do you know how i can safely restrict file acess and still link this files
into a html page, this would for example allow showing a album of photos to
some users but not all site users.
By the way i'm building a new personal web page and will share the code in a
open source i think it would be good for newbies like me
Thankx any way
Miguel
From: James Hicks [EMAIL PROTECTED]
To: Peter Berglund [EMAIL PROTECTED]
Date: Sun, 15 Jun 2003 10:55:33 -0400
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: interact with .htaccess
I think what you really want to do is place your downloadable files in a
directory that is not in your httpd's document root and use a password
protected PHP script to access these files and send them to the user after
authentication. I think you could accomplish this with the fpassthru()
function and the correct header. htaccess is just going to get in your way.
?
include(authentication.php);
$filename=/path/to/directory/not/in/httpd/doc/root/mysecretpicture.jpg;
$fp=fopen($filename, rb);
header( Content-type: image/jpeg\nContent-Disposition: inline;
filename=\mypic.jpg\\nContent-length: .(string)(filesize($filename)) );
fpassthru($fp);
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php