我不确定如何直接解释我的问题。我有通过点击提交按钮发送到数据库的表单。我想要的是在点击提交按钮后从我的表单生成pdf。它应该确认保存这个pdf并在点击保存或取消后应该重定向到另一个页面。我尝试了这段代码,但它没有做我想要的:
$mytext='text from textarea';
include('css/pdf/MPDF57/mpdf.php');
$mpdf=new mPDF();
$htmlbuffer = $mytext;
$mpdf->WriteHTML($htmlbuffer);
$mpdf->SetTitle('Uwagi do planu');
$mpdf->SetAuthor('Name Surname');
$mpdf->Output("test.pdf");
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=test.pdf");
header("Content-Transfer-Encoding: binary");
readFile("test.pdf");
header("Location: index.php?p=info");