0

Hi everyone.
When I deployed my site I got this error: Fatal error: Uncaught Exception: FPDF error: Some data has already been output, can't send PDF file (output started at /srv/disk6/blablasite/rel_funcionario.php:1).
I'm using fpdf v. 1.81 and I am developing in PHP (using XAMPP and Notepad ++), in that platform itworks just fine, but when I uploaded it gave that fatal error.
In the page funcionario.php I show de elements regardind the user (after query on the DB), and if the user wants to print/convert to PDF presses a link

<p><?php echo "<a href=\"./?p=rel_funcionario&func=" . urlencode($nav_links['id_funcionario']). "\" target=\"_blank\">IMPRIMIR RELATORIO</a>"; ?> </p>

In the rel_funcionario.php I get the element func and process the PDF:

<?php
    require ("fpdf/fpdf.php");

    if (isset($_GET['func'])){
        $func_selc = $_GET['func'];
    } else{
        redireciona("./?p=funcionarios");
    }

    $nav_links = obtem_func_id ($func_selc);

    $pdf=new FPDF('P','cm','A4');
    $pdf->AddPage();
    $pdf->SetTitle("blabla");
    $pdf->SetAuthor("blabla");
    $pdf->SetSubject('blabla');
    $pdf->SetFont('Arial','BI',12);
    ...
    $pdf->Cell(0,1,$nav_links['obs'],1,1);
    $pdf->ln();

    $pdf->Output();
?>

I know that I cant send HTML or any spaces (I've looked and checked) but I can't find the problem.

Can anyone help me?

2
Contributors
1
Reply
5
Views
11 Months
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.