title: PHP not auto-populating data in PDF
body: <p>I've been using the advice given in this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/1389964/merge-fdf-data-into-a-pdf-file-using-php">Merge FDF data into a PDF file using PHP</a></p>
  
  <p>to determine how I can pre-populate a pdf form with data pulled from a database but not getting the data to file.  I'm running php 5.3.15 on Mountain Lion and I'm using the following link to combine the pdf with the fdf on a table page that I'd like to allow the user to click and take them to a populated pdf file:</p>
  
  <pre><code>something.pdf#FDF=generatePdf.php
  </code></pre>
  
  <p>The generatePdf.php looks like this:</p>
  
  <pre><code>&lt;?php
  $pdf_form_url= "";
  require_once('forge_fdf.php');
  
  $fdf_data_names= array(); // none of these in this example
  $fdf_data_strings= array(); // none of these in this example
  
  $fdf_data_strings['form1[0].#subform[0].q1a_LastName'] = "Smith";
  $fields_hidden= array();
  $fields_readonly= array();
  
  // set this to retry the previous state
  $retry_b= false;
  
  header( 'content-type: application/vnd.fdf' );
  
  echo forge_fdf( $pdf_form_url,
      $fdf_data_strings, 
      $fdf_data_names,
      $fields_hidden,
      $fields_readonly );
  
  ?&gt;
  </code></pre>
  
  <p>and the FDF file looks like this when I run it through the pdftk command line:</p>
  
  <pre><code>FieldType: Text
  FieldName: form1[0].#subform[0].q1a_LastName[0]
  FieldNameAlt: Enter Family Name
  FieldFlags: 0
  FieldJustification: Left
  FieldMaxLength: 35
  </code></pre>
  
  <p>Still, when I run it the form doesn't auto populate.  I've tried many variations including just using the q1a_LastName by itself and I still end up with an empty form.  The forge_fdf.php is in the same directory.</p>
  
  <p>Update:
  I've also attempted the conventional method outlined in the Merge FDF data into a PDF question that I've linked to using PHP, meaning I didn't just direct the user to a pdf file but also attmepted to have the user download the pdf.  In that particular case, I would receive a message saying the pdf was empty.  I've checked the created raw FDF file and it appears to be populating with data.  In either case, I'm not getting what I need.</p>