[SOLVED] unexpected $ with fpdf
Posted: Wed Aug 24, 2005 4:06 am
Hi there guys, i got the following problem. Maybe you can help me:
I'd like to write a PDF with some HTML & PHP code. So i figured i'd use fpdf. Here is a a little example of the code:
----------------------------------------------------
The actual script is bigger but it's too long to post it here. Anyway. Everytimer i try to run the script i get this msg:
Parse error: parse error, unexpected $ in /web/www/eyemedia_ch/clients/public_html/candyhoover.ch/modules/mo_products_print.php on line 177
with line 177 being the last line of the script.
Now i know that this error usually describes a missing { or } or whatever but i double and triple checked the code. Did anyone expirience this problem before?
Thanks in advance for any help
I'd like to write a PDF with some HTML & PHP code. So i figured i'd use fpdf. Here is a a little example of the code:
----------------------------------------------------
Code: Select all
<?
$html="";
$html=<<<PDF_BODY
<table border="0" cellspacing="0" cellpadding="0" width="600">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="10" width="100%">
<tr>
<td width="100%" valign="top">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="title"><font class="title">{$productlang['name']}</font><td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td>{$description}</td>
</tr>
PDF_BODY;
if ($properties&&{$product['has_properties']}){
$html.=<<<PDF_BODY
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td nowrap><font>{$_TEXT['techdata']}:</font></td>
</tr>
<tr>
<td>
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
<tr>
<td><img src="_images/spacer.gif" border="0" width="1" height="5"></td>
</tr>
PDF_BODY;
// create pdf
$pdf=new PDF();
$pdf->AddPage();
$pdf->SetMargins(20,20,20,20);
$pdf->SetFont('Arial','', 10);
$pdf->SetTextColor(0,0,0);
$pdf->SetXY(20,50);
$pdf->Ln(35);
$pdf->WriteHtml($html);
$pdf->Ln(25);
$pdf->Output();
?>Parse error: parse error, unexpected $ in /web/www/eyemedia_ch/clients/public_html/candyhoover.ch/modules/mo_products_print.php on line 177
with line 177 being the last line of the script.
Now i know that this error usually describes a missing { or } or whatever but i double and triple checked the code. Did anyone expirience this problem before?
Thanks in advance for any help