Page 1 of 1

Restrict a file to called only from a particular file

Posted: Sun Jun 13, 2004 2:51 am
by anjanesh
Hello

I have a file a.php which includes an image m.jpg either using <IMG> or image function - whatever. Now I was this done in such a way that ONLY a.php has the right to include m.jpg. So if m.jog is requested from the server the server should check if the request is coming from the page a.php. I need this done so that other scripts(or html files) have a link to this image or include it.

I am sure there must be some method to do this otherwise in all our sites we could save some images space and just link some common ones to other peoples' sites or even microsoft's.

I am pretty sure this is possible because log ago when I kept linking the images in my angelfire site from my geocities page my angelfire a/c got disconnected due this reason.

Thanks

Posted: Sun Jun 13, 2004 3:48 am
by launchcode
You don't control this from PHP, it's a server setting. Try here: http://altlab.com/htaccess_tutorial.html

Posted: Mon Jun 14, 2004 3:56 pm
by anjanesh
Thanks
SOLVED