在我的網站上,我使用一個名爲mpdf http://www.mpdf1.com/mpdf/index.php的php類來創建用於下載的pdf。在另一個php腳本中使用exec()函數執行php腳本
它通過使用file_get_contents('list.php')
函數來獲取內容爲html,準備轉換爲pdf。
它的作品真的很好,可惜我的網站它只返回實際的PHP代碼,而不是生成的HTML:
<?php include 'inc/head.php'?>
<?php include 'inc/header.php'?>
<?php include 'inc/gold_packageinc.php'?>
<?php include 'inc/footer.php'?>
如果我能想出如何使用前
exec('list.php')
file_get_contents('list.php')
我確定它會工作。事情似乎很難做到。顯然你需要引用php文件或其他東西,但我不能這樣做。我現在創建了一個由PHP驅動的網站,但我不知道什麼是'shell'或什麼!
如果有人能解釋如何讓exec('list.php')工作,我會非常感激!完全開放以解決問題。也許'輸出緩衝'如果有人能解釋?