在header前不能有输出,你的session_start()要去掉

解决方案 »

  1.   

    <?php     $pass = $_SESSION['pass'];    if($pass == "pass")
        {
            header('Content-type: application/x-zip-compressed');
            header('Content-Disposition: attachment; filename=1.zip');
            header('Content-Description: ZIP Generated Data');
            readfile("1.zip");
        }
        else
        {
            die("无权下载");
        }?>
      

  2.   

    其实php现在的版本在php.ini里都默认配置了session_auto_start,你在用$_SESSION注册的时候会自己start的,所以第一句不是很必要了