title: FPDF function control
body: <p>I'm new to programming and I'm creating a pdf with FPDF(A PHP Class). At the bottom of my code you will notice that I create a new page and call the function Header(). For some reason, the header is also applied to the first page. How do I only apply the header to the second page?</p>
  
  <p>Here is a link to a live version of the pdf: <a href="http://fosterinnovationculture.com/experiments/fpdf/index-two.php" rel="nofollow">http://fosterinnovationculture.com/experiments/fpdf/index-two.php</a></p>
  
  <pre><code>&lt;?php
  require('fpdf.php');
  
  // classes
  class PDF extends FPDF
  {
      function Logo(){
          $this-&gt;Image('images/logo.png',1,5.5,3);
      }
      //change name of function
      function HeaderOne($xCor, $yCor, $text) 
      {
          $this-&gt;SetX($xCor);
          $this-&gt;SetY($yCor);
          $this-&gt;SetFont('Arial','B',18);
          $this-&gt;Cell(5,1,$text);
      }        
      //Add bottom border
      function BorderLine() 
      {
          $this-&gt;SetDrawColor(0,0,0);
          $this-&gt;SetFillColor(0,0,0);
          $this-&gt;Rect(1, 10, 6.5, .015, 'F');        
      }
      function Footer()
      {
          // Go to 1.5 cm from bottom
          $this-&gt;SetY(-5.7);
          // Select Arial italic 8
          $this-&gt;SetFont('Arial','I',8);
          // Print centered page number
          $this-&gt;Cell(0,10,'Page '.$this-&gt;PageNo(),0,0,'R');
      }
      function Header(){
          // Subtitle
          $this-&gt;SetY(.25);
          $this-&gt;SetX(1);
          $this-&gt;SetFont('Arial','',12);
          $this-&gt;Cell(6,1,'INNOVATION READINESS ASSESSMENT');
          // Line
          $this-&gt;SetDrawColor(0,0,0);
          $this-&gt;SetFillColor(0,0,0);
          $this-&gt;Rect(1, .5, 6.5, .015, 'F');       
      }
  }
  
  //pdf document preferences
  $pdf = new PDF('p', 'in', 'Letter');
  $pdf-&gt;AddPage();
  $pdf-&gt;SetMargins(1,1,1,1);
  
  //Page 1
  $pdf-&gt;SetDrawColor(238,170,40);
  $pdf-&gt;SetFillColor(238,170,40);
  $pdf-&gt;Rect(1, 1, 6.5, .25, 'F');
  $pdf-&gt;Image('images/header.jpg',1,1.5,6.5,3.5,'JPG','');
  $pdf-&gt;Logo();
  $pdf-&gt;HeaderOne(1,9,'Innovation Readiness Assessment');
  $pdf-&gt;BorderLine();
  
  //Page 2        
  $pdf-&gt;AddPage();
  $pdf-&gt;Header();
  
  // Close and output file to the browser
  $pdf-&gt;Output();
  </code></pre>
  
  <p>?></p>