如何将会话从其他页面捕获到TCPDF?

时间:2019-04-25 11:17:27

标签: php html tcpdf

在我的主页上,我在会话中捕获了一些值/值/选项,因此可以将其用于另一个页面。 如果我尝试回读会话没有问题,但是如果我尝试在tcpdf中使用它,则什么也没有出现。

例如,如果我提交按钮以显示TCPDF页面,我是否会在主页上使用它。

session_start(); 
 if(isset($_POST['BevestigDienst']))
                    {
                        $_SESSION["DatumTijdDienst"] = $_POST['DatumTijdDienst'];
                        $_SESSION["DienstGebruiker"] = $_POST['DienstGebruiker'];
                        $_SESSION["SDienst"] = $_POST['SDienst'];
                        $_SESSION["SSVGebruiker"] = $_POST['SSVGebruiker'];

,然后在其他页面上将此与此一起调用。:

session_start();
$Dienst = $_SESSION["SDienst"];
$tbl_style = '<style type="text/css">.tg .tg-cey7{font-size:8px;background-color:#FF5400;color:#ffffff;text-align:center;vertical-align:middle}</style>';

$tbl_header = '<?php $_SESSION["Dienst"]; ?><table class="tg">';
$tbl_columns = '<tr>
                <th class="tg-cey7" width="50" height="10" >Operator.: </th>
                <th class="tg-cey7" width="100" height="20" >Pascal Schuffelers</th>
                <th class="tg-cey7" width="40" height="20" >Datum.: </th>
                <th class="tg-cey7" width="80" height="20" >02-04-2019</th>
                <th class="tg-cey7" width="40" height="20" >Dienst.: </th>
                <th class="tg-cey7" width="20" height="20" > echo $Dienst </th>
                <th class="tg-cey7" width="80" height="20" >SSV.:</th>
                <th class="tg-cey7" width="120" height="20">echo $Persoon </th>
            </tr>';
$tbl_footer = '</table>';

// Print text using writeHTMLCell()
$pdf->writeHTML($tbl_style . $tbl_header . $tbl_columns . $tbl_footer, true, false, false, false, '');

但是如果我在tcpdf页面上尝试此操作,例如在此行中。

$tbl_columns = '<tr><th class="tg-cey7" width="50" height="10" >Operator.: </th><th class="tg-cey7" width="100" height="20" >Pascal Schuffelers</th><th class="tg-cey7" width="40" height="20" >Datum.: </th><th class="tg-cey7" width="80" height="20" >02-04-2019</th><th class="tg-cey7" width="40" height="20" >Dienst.: </th><th class="tg-cey7" width="20" height="20" ><?php echo $Dienst ?></th><th class="tg-cey7" width="80" height="20" >SSV.:</th><th class="tg-cey7" width="120" height="20"><?php echo $Persoon; ?></th></tr>';

我看到了所有东西,但看不到$ Dienst。

<th class="tg-cey7" width="20" height="20" ><?php echo $Dienst ?>

我怎么了?

0 个答案:

没有答案