RE: [PHP] Block direct image loads but allow them in PHP

2003-02-19 Thread Rich Gray
[snip] > > if(isset($i)) > { > //codeImageURL decodes $i into an image path that we can work with > $link=codeImageURL($i); > if($link!="" && (isAdmin() || !isThisFileBlocked($link))) > { > header("Cache-control: private"); > header("Content-type: image/jpg"); >

Re: [PHP] Block direct image loads but allow them in PHP

2003-02-18 Thread Michael Mulligan
So I implemented this the other day and got excited as it worked...sort of. My code is very similar to the link that you suggested. This is the script that I would call from within an : if(isset($i)) { //codeImageURL decodes $i into an image path that we can work with $link=codeImageURL($i

Re: [PHP] Block direct image loads but allow them in PHP

2003-02-16 Thread Michael Mulligan
Thank you, this looks like the kind of thing I'm looking for. I'll have to give this a shot and see how it goes. :-) On 02/15/03 8:44 PM, "Justin French" <[EMAIL PROTECTED]> wrote: > Using Apache's main config file (or at a per-directory level using a > .htaccess file), you need to black all .jpg

Re: [PHP] Block direct image loads but allow them in PHP

2003-02-15 Thread Justin French
Using Apache's main config file (or at a per-directory level using a .htaccess file), you need to black all .jpg, .jpeg, .gif, .png, .bmp, etc etc files from being *directly* served via http. I'm not too good with Apache yet, but an example would be: Order Allow,Deny Deny from all

Re: [PHP] Block direct image loads but allow them in PHP

2003-02-15 Thread Michael Mulligan
I hadn't considered that before. Thank you. :-) The reason why though is that Mac OS X comes with permissions set by default so that Apache can't wander outside of the publicly accessible folder (~/Sites/). The script that I have written is something that I intend to distribute to other Mac users

Re: [PHP] Block direct image loads but allow them in PHP

2003-02-15 Thread Marco Tabini
On Sat, 2003-02-15 at 11:24, Michael Mulligan wrote: > The script that I will distribute will always make use of a very particular > directory structure. In "imageDir", there will always be a specifically > named XML file that points to a bunch of images in the directory. However, > given security

Re: [PHP] Block direct image loads but allow them in PHP

2003-02-15 Thread Michael Mulligan
Perhaps you could further describe such a method? I'm sorry, I just don't quite see how this will block the files. Perhaps I should further explain my situation. The script that I will distribute will always make use of a very particular directory structure. In "imageDir", there will always be a s

Re: [PHP] Block direct image loads but allow them in PHP

2003-02-15 Thread Marco Tabini
On Sat, 2003-02-15 at 11:13, Michael Mulligan wrote: > If the user knew the actual URL of the image though, wouldn't they be able > to get around a script like this by simply typing it into their web browser? > > Thanks! :-) Only if you let them. The PHP script allows to put the appropriate check

Re: [PHP] Block direct image loads but allow them in PHP

2003-02-15 Thread Michael Mulligan
If the user knew the actual URL of the image though, wouldn't they be able to get around a script like this by simply typing it into their web browser? Thanks! :-) > On 02/15/03 10:55 AM, "Marco Tabini" <[EMAIL PROTECTED]> wrote: > I guess the easiest would be to filter those images through a php

Re: [PHP] Block direct image loads but allow them in PHP

2003-02-15 Thread Marco Tabini
On Sat, 2003-02-15 at 11:00, Michael Mulligan wrote: > Hi > > I have a bit of a problem which might just be due to my lack of knowledge > with Apache. Basically, what I want to do is to *not* allow users to enter > particular URLs in their browser (namely to *.jpg and *.xml files under a > particu