title: FPDF : Outputs php file insted of pdf file
body: <p>i am using FPDF to output form data into PDF file.but when i click on submit button to post the data to generatepdf.php file , it outputs generatepdf.php file instead of right PDF file.below is my code.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form action="generatepdf.php" method="post" enctype="multipart/form-data" onsubmit="return validation();" &gt;
  
  &lt;input type="text" name="business_name" id="business_name" /&gt;&lt;/br&gt;
  
  
  &lt;input type="file" name="logo" id="logo" accept="image/*" &gt;&lt;/br&gt;
  &lt;input type="submit" value="generate" name="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>generatepdf.php</strong></p>
  
  <pre><code>require('fpdf/fpdf.php');
  
  $allowedExts = array("gif", "jpeg", "jpg", "png");
  $temp = explode(".", $_FILES["logo"]["name"]);
  $extension = end($temp);
  if ((($_FILES["logo"]["type"] == "image/gif")|| ($_FILES["logo"]["type"] == "image/jpeg")|| ($_FILES["logo"]["type"] == "image/pjpeg")|| ($_FILES["logo"]["type"] == "image/x-png")
  || ($_FILES["logo"]["type"] == "image/png"))
  &amp;&amp; in_array($extension, $allowedExts))
    {
    if ($_FILES["logo"]["error"] &gt; 0)
      {
      echo "Return Code: " . $_FILES["logo"]["error"] . "&lt;br&gt;";
      }
    else
      {
        if (file_exists("upload/" . $_FILES["logo"]["name"]))
        {
        echo $_FILES["logo"]["name"] . " already exists. ";
        }
        else
        {
          $logo = date('dmYHis').$_FILES["logo"]["name"];
          move_uploaded_file($_FILES["logo"]["tmp_name"], "images/" . $logo);
          $pdf=new FPDF();
  
          //set document properties
          $pdf-&gt;SetAuthor('Suraj Ahir');
          $pdf-&gt;SetTitle('Test');
  
          //set font for the entire document
          $pdf-&gt;SetFont('Helvetica','B',20);
          $pdf-&gt;SetTextColor(50,60,100);
  
          //set up a page
          $pdf-&gt;AddPage('P');
  
  
          //insert an image and make it a link
          $image = 'D:\wamp\www\exportpdf\1.jpg';
          $pdf-&gt;Image($image,10,20,33,0,' ','http://www.fpdf.org/');
  
  
          $logoimage = "D:\wamp\www\\exportpdf\images\\".$logo;
          $pdf-&gt;Image($logoimage,10,220,25,25);
  
          //Output the document
          $name = date('dmYHis');
          $pdf-&gt;Output($name.'.pdf','I'); 
        }
      }
   }
  </code></pre>