html表单数据到pdf html标签丢失

时间:2018-09-10 09:07:32

标签: php fpdf

提交表单后,我拥有表单,帖子值应转换为pdf usinf fpdf

我的功能

$pdf = new PDF();
$pdf->AddPage();
$pdf->SetFont('Arial', '', 12);
$html = '<table border="1" >
    <tr>
        <td width="150" height="30">Company Name: </td>
        <td width="200" height="30"> ' . $_POST['c_name'] . '</td>
    </tr>
    <tr>
        <td width="150" height="30">Country: </td>
            <td width="200" height="30"> ' . $_POST['Country'] . '</td>
    </tr>
    <tr>
        <td width="150" height="30">Contact person:</td>
            <td width="200" height="30"> ' . $_POST['Contact_Person'] . '</td>
    </tr>
    <tr>
        <td width="150" height="30">Email id:</td>
            <td width="200" height="30"> ' . $_POST['emailid'] . '</td>
    </tr>
    <tr>
        <td width="150" height="30">Phone number:</td>
            <td width="200" height="30"> ' . $_POST['phone'] . '</td>
    </tr>

</table>';

echo $html;
exit;

转换页面:

$pdf->WriteHTML($html);
$rand = mt_rand();

当我呼应我的桌子时,我得到了 MY form

表格被转换为pdf,但是html标签丢失了。我没有得到预期的输出 任何帮助将不胜感激

0 个答案:

没有答案
相关问题