doulin9679 2014-06-25 23:24
浏览 52

来自另一个页面的mPDF $ _POST不起作用

I generate a beautiful looking html based pdf but for some reason, sending my html form to my mpdf generator only works outside of $html = ''...

I send my data from the html form (form.html) then the mpdf php page receives those post variables. But when I use a simple php tag like $_POST['Preparedby'] in my $html='' it doesnt work.

Here's a snippet:

$html= '
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="12"><img src="logo/xxtrasmsw.png"></td>
  </tr>
  <tr>
    <td colspan="12">Eval Form</td>
  </tr>
  <tr >
    <td width="11%">Prepared By</td>
    <td colspan="7" class="bb">'.$preby.'</td>
    <td width="11%">Date Prepared</td>
    <td colspan="3" class="bb">'.$_POST['DatePrepared'].'</td>
  </tr>
  <tr>
</table>';

and my mpdf settings just below the table html looks like:

$PdfFileName =  "evaluation.pdf"; //declare my pdf file
$mpdf=new mPDF('c','Letter');
$mpdf->allow_charset_conversion=true;
$mpdf->charset_in='ISO-8859-2';
$mpdf->SetDisplayMode('fullpage');
$mpdf->list_indent_first_level = 0;
$mpdf->WriteHTML($html);
$emailAttachment = $mpdf->Output('evaluation.pdf', 'S');

This works great with PHPMailer so i wont include those settings. I need clarity on how to get my post variables to show up in my $html variable mpdf is using. Any help with this would get me over this terrible hurdle.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 雷达辐射源信号参考模型
    • ¥15 html+css+js如何实现这样子的效果?
    • ¥15 STM32单片机自主设计
    • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
    • ¥15 不小心不正规的开发公司导致不给我们y码,
    • ¥15 我的代码无法在vc++中运行呀,错误很多
    • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
    • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000
    • ¥30 ppOCRLabel导出识别结果失败
    • ¥15 Centos7 / PETGEM