Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Stut
Jon Anderson wrote: Greg Donald wrote: There will be legitimate requests that will fail since not all browsers send a referer. How many browsers out there that support the Java plug-in will not support referrers? Besides, the simple solution to that problem is just check for a non-existant

Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Jon Anderson
Greg Donald wrote: There will be legitimate requests that will fail since not all browsers send a referer. How many browsers out there that support the Java plug-in will not support referrers? Besides, the simple solution to that problem is just check for a non-existant referrer. If the bro

Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Greg Donald
On 5/7/07, Jon Anderson <[EMAIL PROTECTED]> wrote: In the context, I think the only thing that matters is that other people don't link to his jar file from other websites. There will be legitimate requests that will fail since not all browsers send a referer. -- Greg Donald http://destiney.c

Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Jon Anderson
Greg Donald wrote: $_SERVER['HTTP_REFERER'] is unreliable. http://us2.php.net/manual/en/reserved.variables.php#reserved.variables.server So? In the context, I think the only thing that matters is that other people don't link to his jar file from other websites. jon -- PHP General Mailin

Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Greg Donald
On 5/7/07, Jon Anderson <[EMAIL PROTECTED]> wrote: if (strpos($_SERVER['HTTP_REFERER'],'http://www.myweb.com/') === 0) { header('Content-Type: application/java-archive'); readfile('/path/to/real/jarfile.jar'); exit(0); } $_SERVER['HTTP_REFERER'] is unreliable. http://us2.php.net/m

Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Jon Anderson
pw wrote: I have a phtml file that contains a reference to a java archive (jar) file. I only want the archive used in the context of a specific html page. I don't want the archive to be downloaded directly. I can think of two easy ways to do this. If you're using Apache, you could fiddle wit

Re: [PHP] Blocking the direct download of a file

2007-05-07 Thread Davi
Em Segunda 07 Maio 2007 12:36, pw escreveu: > $referrer=$_SERVER['HTTP_REFERRER']; > if(strcmp($referrer,"http://www.myweb.com/index.phtml";)==0) > { > > header("Location: ./primary.jar"); > } > else > { > header("Location: ./secondary.jar"); > }

[PHP] Blocking the direct download of a file

2007-05-07 Thread pw
Hello, I have a phtml file that contains a reference to a java archive (jar) file. I only want the archive used in the context of a specific html page. I don't want the archive to be downloaded directly. I thought, at first, I could just use a php page as my jar reference: I would