title: How to generate a pdf file by clicking submit button?
body: <p>The code is given.. i want to generate a pdf with content,what i entered in the text field </p>
  
  <pre><code>&lt;form method= 'post' action =''&gt;
  
  Name&lt;input type="text" name="name"&gt;
  
  &lt;input type="submit" value="submit" name="submit"&gt;
  
  &lt;/form&gt;
  
  &lt;?php
  
  require("fpdf.php");
  
  $pdf = new FPDF();
  
  $pdf-&gt;AddPage();
  
  $pdf-&gt;SetFont('Arial','B',16);
  
  $a=$_POST["add"];
  
  $pdf-&gt;Cell(40,10,$a);
  
  $pdf-&gt;Output();
  
  ?&gt;
  </code></pre>
  
  <p>but the result is...    </p>
  
  <p><strong>FPDF error: Some data has already been output, can't send PDF file</strong>   Somebody plz help</p>