... <看更多>
「php header pdf」的推薦目錄:
- 關於php header pdf 在 [請益] header下載多個檔案- 看板PHP - 批踢踢實業坊 的評價
- 關於php header pdf 在 correct PHP headers for pdf file download - Stack Overflow 的評價
- 關於php header pdf 在 PHP Header Examples - gist GitHub 的評價
- 關於php header pdf 在 Force pdf download not working when include blog-header.php 的評價
- 關於php header pdf 在 Header Type PDF | Header Type PHP - YouTube 的評價
php header pdf 在 PHP Header Examples - gist GitHub 的推薦與評價
echo file_get_contents('filename.pdf'); ?> Cache (force browsers not to cache files):. ... <看更多>
php header pdf 在 Force pdf download not working when include blog-header.php 的推薦與評價
I think Wordpress is having problem with the url of your external script and throws a 404 error from the handle_404() function in the wp ... ... <看更多>
php header pdf 在 Header Type PDF | Header Type PHP - YouTube 的推薦與評價

Header Type ? Header Function is For transfer other Web Page or URL ! it's can transfer web address, or ... ... <看更多>
php header pdf 在 [請益] header下載多個檔案- 看板PHP - 批踢踢實業坊 的推薦與評價
如題,新手到不行的問題...
我想要將 sever上的pdf檔案資料,按照順序排出並且用 checkbox來標明
然後在使用上可以勾選想要的檔案作為下載。
所以我寫了一個 PHP程式 將以選好的 ID(尋找pdf檔用)以post丟入程式
轉成對應pdf的檔名後以header下載。
問題來了: 假如只點選一個檔案的話 程式可以安然的下載pdf。
但是我復選checkbox 卻只會下載第一個pdf..
但是我將header部分的成是拿掉..改為只show 選取的檔名,卻又都可以顯示
我只能猜想..在header執行的時候網頁轉去其他地方造成 ID被洗掉?
以下附上程式,希望有人可以幫忙
<?php
foreach($_POST['select'] as $id => $item ){
$select_id[] = $id ;
}
require_once("dbconnect.php");
foreach($select_id as $ID)
{
$paper_search_str = "SELECT bibtext, label, title FROM archive WHERE paper_id
=".$ID ;
$paper_result = mysql_query($paper_search_str);
while($rows = mysql_fetch_array($paper_result)){
$label = $rows["label"];
$title = $rows["title"];
}
$filename= $label.'-'.$title.".pdf" ;//對應檔名
dp($filename) ; //下載的指令..假如不用改為下一行只顯示 就可以多個檔名都顯示
//echo $filename.';'.'<br>' ;
}
mysql_close();
?>
<?
function dp($filename){
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename='.$filename);
readfile('./file_dir/'.$filename);
exit();
}
?>
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.109.103.227
※ 文章網址: https://www.ptt.cc/bbs/PHP/M.1458618693.A.DCE.html
※ 編輯: fefeking (140.109.103.227), 03/22/2016 11:53:21
回應一下..我的database是在 mySQL底下,嘗試了用PHP內建的 ZipArchive 跟
Pclzip 都不成功,連基本的壓縮同資料夾底下的 txt file都不行。我不清楚問題在哪
持續嘗試中..
... <看更多>