关于PHP下载程序如何支持迅雷 请教各位大虾,我想用PHP写一个下载程序down.php,想支持迅雷下载,但是有一个问题,我的网页做了SESSION登陆,要求登陆了才能下载,但是我现在写出来的效果是用登陆以后用迅雷下载,下载出来的是down.php,打开这个文件看了里面的代码,提示是没有登陆,请问这个问题应该怎么解决? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function file_down($file,$filename=''){ file_exists($file) or die('文件不存在'); $filename = $filename ? $filename : basename($file); $filetype = fileext($filename); $filesize = filesize($file); header('Cache-control: max-age=31536000'); header('Expires: '.gmdate('D, d M Y H:i:s', time() + 31536000).' GMT'); header('Content-Encoding: none'); header('Content-Length: '.$filesize); header('Content-Disposition: attachment; filename='.$filename); header('Content-Type: '.$filetype); readfile($file); exit;} 谢谢楼上的,我已经找到解决方法了可以利用session_id()来解决登陆的问题 如何从用GET方式提交的表单中获取信息? 做不出来,一道难题困了我一天了 ASP。NET 转学习 PHP 在我的ASP.NET中一个页面中有一个Form都不用写要Post到哪里去那Php的话是不是都要指定Post都哪里去啊,谢谢 请教高手,关于ioncube的具体用法 求助各位大大:邮件的附件,上传后怎么处理? 上海php收入排行 为什么老是提示超时?! 帮帮忙, 怎样用pear DB连数据库,看看我的最简单代码 apach+linux 如何进行用户身份认证?急! 图片文件,缓存文件等,有必要分很多文件夹吗? PHP高手们都进来看看,白拿的分数 如何判断函数是否已经执行过一次?
{
file_exists($file) or die('文件不存在');
$filename = $filename ? $filename : basename($file);
$filetype = fileext($filename);
$filesize = filesize($file);
header('Cache-control: max-age=31536000');
header('Expires: '.gmdate('D, d M Y H:i:s', time() + 31536000).' GMT');
header('Content-Encoding: none');
header('Content-Length: '.$filesize);
header('Content-Disposition: attachment; filename='.$filename);
header('Content-Type: '.$filetype);
readfile($file);
exit;
}