Jump to content

Archived

This topic is now archived and is closed to further replies.

topjimmie

Proper syntax for referencing PHP variable in TCPDF code

Recommended Posts

I am generating a PDF file using POST method from an HTML form for the values.  I can't seem to get the syntax right or something.  When I enter a placeholder in the PHP code for TCPDF, I still do not see my value on the generated file.

 

Example:  My field is called $hidformtitle which is just a string.

Here is what I am putting into the pdf script (I'm just using example_014.php from TCPDF for proof of concept to test with.):

 

// Form Subject Test
$pdf->Cell(35, 5, 'Form Title:');
$pdf->TextField($_POST ['hidformtitle'], 50, 5);
$pdf->Ln(6);

 

Could someone provide an example to me of how you would insert this a field using the same method.  It does not have to relate in any way to what I've posted here as far as the code goes.  I honestly just don't know what I'm doing any more and need an example.

 

My sanity may depend on this as I started out thinking this is pretty simple stuff and now I'm not sure of anything.

 

THANK YOU!

Share this post


Link to post
Share on other sites

You are going about it backwards. That is for the what would be name= of the input widget.

The file referenced in the submit button dialog handles the vars just as if it were submitted from an html form, In the example the pdf reader would expect to hand the data off to to a file named printvars.php located in the website root.

 

 

HTH

Teamatomic

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.