include './admin/connect.php';
@extract($db->get_one("select * from movieinfo where id='".$_GET['id']."'"));
$db->query("update movieinfo set downnum=downnum+1 where id='".$_GET['id']."'");
//控制下载
$url2="./admin/";//存放电影的路径
if($localaddress)
{
$newname=$localaddress;
$movieurl=$url2.$newname;
}
$type=basename($movieurl);
$type= substr(strrchr($type,'.'),0);
$filename=$title.$type;
$file=fopen($movieurl,'r');
ob_end_clean();
header('Content-type: application/octet-stream');
header('Accept-Ranges: bytes');
header('Accept-Length:'.filesize($movieurl));
header("Content-Disposition: attachment; filename=".$filename);
echo fread($file,filesize($movieurl));
fclose($file);
exit;
?>
|