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.