protecting video files
| From: | Tim Schulte | Date: | Fri, 11 May 2001 21:09:08 +0000 |
| Subject: | protecting video files | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-52519@lists.php.net to get a copy of this message | ||
Hi there -
I am having some weird problems here. I am try to write a script that
will check to see where a movie file is being called from. I want to define
which web page I will allow a movie to be called from, and block all others.
The script so far looks like this:
The file gets called like this
http://www.hardcorehosting.com/video/playmovie.php?movie=test.mov
============ playmovie.php ===============
<?php
header("Content-type: video/quicktime");
$file=fopen($movie, "r");
fpassthru($file);
?>
============= end script ===================
which works fine until I add this at the top
if($HTTP_REFERER != "http://www.hardcorehosting.com/video/test.html")
{
exit();
}
to check and see where the page is being called from. It then gives me a
broken image. I've checked for space's and can't see what I'm doing wrong
:( Any suggestions ?? Thanks.
Tim Schulte
webmaster@hardcorehosting.com