2012-04-13 52 views
0

我已在HTML和CSS網站,然後我已經使用這個代碼,將其轉換爲PDF格式:MPDF不轉換PHP函數

<?php 

include("mpdf/mpdf.php"); 

$mpdf=new mPDF('c','A4','','' , 0 , 0 , 0 , 0 , 0 , 0); 
$mpdf->SetDisplayMode('fullpage'); 

$mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the 
first level of a list 

$mpdf->WriteHTML(file_get_contents('myhtmlcssfile.php')); 
$mpdf->Output(); 

?> 

一切都很好,它的轉換PHP文件非常直到我使用這個功能:

<?php echo $_POST["something"]; ?> 

其中「東西」是從形式領域。
所以它不打印什麼POST方法發送,只有php代碼。
我在做什麼錯?

回答

1

我發現,當你使用「文件獲取內容」命令它只讀取文件,它不執行文件。 您將需要實際將您的HTML編碼到頁面中。

$mpdf->WriteHTML('put your page code here.'.$put your $_POST["something"] values here.' Continue page code.');