0
Within a variable PHP have a content HTML. to be shown.
So I did
$htmlPDF = $html;
$html .= "
<form action='pdf.php' method='post'>
<input type='hidden' name='htmlPDF' value='" . $htmlPDF . ".</div>' />
<input type='submit' class='button formularios' value='Gerar PDF' />
</form><br /><br />
<button id='btnGrafico' class='button formularios'>Gerar Gráfico</button><br />
<canvas class='line-chart'></canvas>
";
That one maneuvering is that before displaying the buttons I need to pick up content HTML until then.
The problem:
When I’m gonna show off $html, Besides leaving the content itself once is also leaving the content of variable $htmlPDF that is in
<input type='hidden' name='htmlPDF' value='" . $htmlPDF . "' />
In other words, contained duplicate.
What is wrong here?
Obs.: if I do:
<input type='hidden' name='htmlPDF' value='' />
The contents display normally
Already tried without double quotes: leaving only
value=' $htmlPDF '
– hugocsl
yes, it gave the same thing. I added an image!
– Carlos Rocha
The content is duplicated because you match the
$htmlPDF
previous content of $html here:$htmlPDF = $html;
... That is, to the variable$htmlPDF
is assigned ALL content of the$html
previous. Then you concatenate ALL content with the htmlPDF variable that contains all the previous HTML...– Andrei Coelho
But how should I put $htmlPDF as the value of INPUT Hidden so that this duplication does not occur? That is the exception of the question and my doubt! And also I do not see in the code any omde dou echo or print in the variable $htmlPDF. You saw where my trouble is?
– Carlos Rocha
Dreamweaver? @_@
– LipESprY