title: How to use html form data for fpdf form creation
body: <p>i am trying to create a pdf email using data inputed into a html form. I don't know how to use data from a mysql database or html form to create a pdf using fpdf and email it. I am close to finishing this project i have been working on and need help closing off the deal i have a difficult html form using specially spaced tables and such trying to reproduce a excel document to a html form doing javascript calculations and now all i need to do is email this form in a pdf format using php or something using my linux webserver. please i really want to know this for myself as well. i have learned alot in the past few weeks about html,php,mysql, and javascript and i started this as a project for fun and now people want it. Sorry. And thank you all for all your help for teaching me this information. ok heres the code. </p>
  
  <pre><code>  &lt;!DOCTYPE html&gt;
    &lt;html&gt;
    &lt;head&gt;
   &lt;?php
   $intro = mysql_real_escape_string($_POST['intro']);
   $hostname ="localhost";
   $db_user = "someuser";
   $db_password = "somepassword";
   $database = "form_something";
   $db_table = "FORM";
   $db = mysql_connect ($hostname, $db_user, $db_password);
   mysql_select_db($database,$db);
   ?&gt;
    &lt;title&gt;&lt;h2&gt;this is my form&lt;/h2&gt;&lt;title&gt;
    &lt;?php
    if (isset($_REQUEST['Submit'])) { 
    # THIS CODE TELLS MYSQL TO INSERT THE DATA FROM THE FORM INTO MY MYSQL TABLE 
    $sql = "INSERT INTO $db_table(information) values ('".mysql_real_escape_string(stripslashes($_REQUEST['information']))."')";
    if($result = mysql_query($sql ,$db)) { 
    echo &lt;h1&gt;Thank you&lt;/h1&gt;information has been entered into our database&lt;br&gt;&lt;img   src="http://someimage.com/here/is/the/image.jpg"';
   {
   p
   } else 
   { 
   echo "ERROR: ".mysql_error(); 
   }
   } else 
   {
   ?&gt;
    ?&gt;
    &lt;/head&gt;
    &lt;form action="pdf.php"&gt;
    &lt;td colspan="2"&gt;type your information here&lt;input type="text" name="information"&gt;
    &lt;input type="submit" name="Submit" value="Submit"&gt;
    &lt;/body&gt;
    &lt;/form&gt;
    &lt;/html&gt;
  </code></pre>
  
  <p>and the basic fpdf page pdf.php looks like this</p>
  
  <pre><code> &lt;?php
  require('fpdf.php');
  
  class PDF extends FPDF
   {
   // Page header
  function Header()
  {
  // Logo
  $this-&gt;Image('logo.png',140,6,60);
  // Arial bold 15
  $this-&gt;SetFont('Arial','B',15);
  // Move to the right
  $this-&gt;Cell(60);
   // Title
  $this-&gt;Cell(80,10,' Form',1,0,'C');
  // Line break
  $this-&gt;Ln(20);
  }
  
  function Footer()
  {
  // Position at 1.5 cm from bottom
  $this-&gt;SetY(-15);
  // Arial italic 8
  $this-&gt;SetFont('Arial','I',8);
  // Page number
  $this-&gt;Cell(0,10,'Page '.$this-&gt;PageNo().'/{nb}',0,0,'C');
  }
  }
  
  $pdf = new PDF();
  $pdf-&gt;AliasNbPages();
  $pdf-&gt;AddPage();
  $pdf-&gt;SetFont('Times','',12);
  for($i=1;$i&lt;=40;$i++)
  $pdf-&gt;Cell(0,10,'Printing line number '.$i,0,1);
  $pdf-&gt;Output();
  ?&gt;
  </code></pre>