http://www.cnblogs.com/sum41van/articles/1422450.html

解决方案 »

  1.   

    b.com/a.php?url=http://a.com/a.rar
    如果文件不大可以这样写$url = isset($_GET['url'])? $_GET['url'] : '';if($url){
        $content = file_get_contents($url);
        if($content){
            header('cache-control:public');
            header('content-type:application/octet-stream');
            header('content-disposition:attachment; filename='.basename($url));
            echo $content;
        }
    }
      

  2.   

    要保证
    1.天朝可以访问b.com
    2.b.com可以访问a.com
      

  3.   

    可以使用 curl$url = '传入的目标url';
    $ch = curl_init(); //初始化
    curl_setopt($ch, CURLOPT_URL, $url);
    //curl_setopt($ch, CURLOPT_REFERER, '某个来路url'); //伪造来路页面
    curl_setopt($ch, CURLOPT_HEADER, 1); 
    curl_setopt($ch, CURLOPT_WRITEFUNCTION, 'func');
    curl_exec($ch); //执行function func($ch, $str) {
      static $s = '@';
      if($s) {
        $s = trim($str);
        if($s) header($s);
      }else echo $str;
      return strlen($str);
    }
      

  4.   


    下載過的文件大小加起來?
    echo strlen($content); 
    可以獲取大小后記錄在數據庫。
      

  5.   


    下載過的文件大小加起來?
    echo strlen($content); 
    可以獲取大小后記錄在數據庫。
    谢谢啦,今天学了一天的html把代码整合进去的作品
      

  6.   


    下載過的文件大小加起來?
    echo strlen($content); 
    可以獲取大小后記錄在數據庫。
    谢谢啦,今天学了一天的html把代码整合进去的作品
    http://qqgae.byethost16.com/1/