header — Send a raw HTTP header
header('Content-type:application/force-download');
header('Content-type:application/force-download'); //告訴瀏覽器 為下載
header('Content-Transfer-Encoding: Binary'); //編碼方式
header('Content-Disposition:attachment;filename='.$filename); //檔名
@readfile($filename);
header('Content-type:application/force-download'); //告訴瀏覽器 為下載
header('Content-Transfer-Encoding: Binary'); //編碼方式
header('Content-Disposition:attachment;filename=hello.txt'); //檔名
echo 'Hello PHP';
$filename = "theDownloadedFileIsCalledThis.mp3";
$myFile = "/absolute/path/to/my/file.mp3";
$mm_type="application/octet-stream";
header("Cache-Control: public, must-revalidate");
header("Pragma: hack"); // WTF? oh well, it works...
header("Content-Type: " . $mm_type);
header("Content-Length: " .(string)(filesize($myFile)) );
header('Content-Disposition: attachment; filename="'.$filename.'"');
header("Content-Transfer-Encoding: binary\n");
readfile($myFile);
?>
// We'll be outputting a PDF
header('Content-type: application/pdf');
// It will be called downloaded.pdf
//header('Content-Disposition: attachment; filename="downloaded.pdf"');
// The PDF source is in original.pdf
readfile('2007.pdf');
警告: 網頁已經過期 已經使用您在表格傳送的資訊,來建立您要求的網頁。這個網頁已經無法再使用。基於安全性考量,Internet Explorer 不會自動為您重新傳送資訊。
header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
header("Location: http://www.google.com.tw");
header("Location: http://www.google.com.tw");
sleep(1);
header("Location: http://www.yahoo.com.tw");
header("Location: http://www.google.com.tw");
flush();
sleep(1);
header("Location: http://www.yahoo.com.tw");
header("Location: http://www.google.com.tw");
exit;
sleep(1);
header("Location: http://www.yahoo.com.tw");
flush();
header("Location: http://www.yahoo.com.tw");
Cannot modify header information - headers already sent
Post your comment:
Powered By 2013-2015 ©. Juszeil Conception version 2.0
Queries Executed : 0.0108 seconds