Re: Blocking the direct download of a file

From: Date: Mon, 07 May 2007 16:33:51 +0000
Subject: Re: Blocking the direct download of a file
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-254502@lists.php.net to get a copy of this message
On 5/7/07, Jon Anderson <jon@gamingsolutions.ca> 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/manual/en/reserved.variables.php#reserved.variables.server -- Greg Donald http://destiney.com/

« previous php.general (#254502) next »