1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
|
<?php
function makeDownload($file, $dir, $type) {
header("Content-Type: $type");
header("Content-Disposition: attachment; filename=\"$file\"");
readfile($dir.$file);
}
$dir = '/www/htdocs/v148865/hemsin_vid/';
$type = 'video/x-ms-wmv';
$defaulturl = "http://www.hemsinliyiz.biz";
$httpref = $_SERVER['HTTP_REFERER'];
$reffer = substr($httpref, 0, 32);
if (eregi("http://www.hemsinliyiz.biz",$reffer)) {
if(!empty($_GET['file']) && !preg_match('=/=', $_GET['file'])) {
if(file_exists ($dir.$_GET['file'])) {
makeDownload($_GET['file'], $dir, $type);
}
}
}else if (eregi("http://www.bulutlarinulkesi.com",$reffer)) {
if(!empty($_GET['file']) && !preg_match('=/=', $_GET['file'])) {
if(file_exists ($dir.$_GET['file'])) {
makeDownload($_GET['file'], $dir, $type);
}
}
} else {
header("Location: $defaulturl");
}
?> |