will anybody please help me with this code..since it will give me this error:
FPDF error: Some data has already been output, can't send PDF file...
my php code below:
<form method="POST" action="">
<input type="submit" name="print"value="PRINT">
</form>
<?php
if (isset($_POST['print']))
{
require('fpdf/fpdf.php');
class PDF extends FPDF
{
// Page header
function Header()
{
$this->SetFont('Arial','B',14);
$this->Cell(30,10,'Negros Oriental High School','C');
$this->Ln();
$this->SetFont('Arial','',12);
$this->Cell(0,0,'Dumaguete City');
$this->Ln();
$this->SetFont('Arial','',14);
$this->Cell(0,20,'OFFICIAL RECEIPT');
$this->Ln();
}
}
// Instanciation of inherited class
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->Output();
}
?>