downloads stop before end
Posted: Sat Mar 10, 2007 2:04 pm
I have this to stop hotlinking:
but the downloads stop after a few minutes and say they are complete??
anyone know wy?
thanks
Code: Select all
<?php
$file=$_GET['file'];
$ref=($_SERVER['HTTP_REFERER']);
$valref=substr($ref, 0, 29);
if($valref == "http://www.xxxxx.com/"){
header('Content-type: video/x-msvideo');
header('Content-Disposition: attachment; filename=' . $file . '.avi');
readfile('D:/inetpub/www-xxxx.com/xxx/' . $file . '.avi');
} else {
if($valref == ""){
?>
There is a problem with your referer.<p>
This means your browser has not told us where you got this link from.<p>
Please check <a href="http://www.xxxxx.com/viewforum.php?f=64">help</a> for more info.
<?
} else {
// Your email address
$email = "info@xxxxx.com";
// The subject
$subject="Invalid referer for video download";
// The message
$comment=$ref;
// The message
$emailfrom= "info@xxxxx.com";
mail($email, $subject, $comment, "From: $emailfrom");
?>
Hotlinking? Tut tut.
<p>
We have recorded which website sent you here and will be taking action.
<p>
If this message has been received in error, please goto our <a href="http://www.xxxxx.com/viewforum.php?f=64">help</a> section to find out why.
<?
}
}
?>anyone know wy?
thanks