Jump to content

Proper syntax for referencing PHP variable in TCPDF code


topjimmie

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!

Link to comment
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.