Code Chống ăn cắp băng thông (bandwidth)
.htaccess
http://forum.vndownload.org/showthread.php?t=1832
order deny,allow
deny from all
session_start();
$filedownload = "download/".$filename;
if ((isset($filename)) & $_SESSION['ticket'] == 'Giá trị bất kỳ nào đó') {
function filenotfound() {
include "header.php";
echo '';
include "footer.php";
die();
}
if (!file_exists($filedownload)) filenotfound();
@$handle = fopen ($filedownload, "r") or filenotfound();
header("Content-disposition: filename=$filename");
header("Content-type: application/octetstream");
header("Pragma: no-cache");
header("Expires: 0");
$contents = fread ($handle, filesize ($filedownload));
echo $contents;
fclose ($handle);
}
else {
$_SESSION['ticket'] = 'Giá trị bất kỳ nào đó';
echo '
Download file dap7.zip
';
}
?>
http://forum.vndownload.org/showthread.php?t=1832
Nhận xét
Đăng nhận xét