Dewit Lesley February 2016

Getting error output started

I've been breaking my head about this code. It gives me an error:

Fatal error: Uncaught exception 'Exception' with message 'FPDF error: Some data has already been output, can't send PDF file (output started at /customers/0/c/6/wmc-corner.be/httpd.www/DeLijn/Dienstwissel/pdf_wissel.php:1)'

I've created the page and it worked perfectly untill changing a few minor things. Values are sent via a form. The error should be somewhere in the FPDF code but I'm unable to find it.

pdf_wissel.php

<?php
require ($_SERVER['DOCUMENT_ROOT']."/FPDF/fpdf.php");
include ($_SERVER['DOCUMENT_ROOT']."/db/connect-db.php");
$aanvrager=mysqli_real_escape_string($link,htmlspecialchars($_POST['aanvrager']));
$collega= mysqli_real_escape_string($link,htmlspecialchars($_POST['aanvrager']));
$Datumw= mysqli_real_escape_string($link,htmlspecialchars($_POST['Datumw']));
$Datumt= mysqli_real_escape_string($link,htmlspecialchars($_POST['Datumt']));
$Dienstw1= mysqli_real_escape_string($link,htmlspecialchars($_POST['Dienstw1']));
$Dienstw2= mysqli_real_escape_string($link,htmlspecialchars($_POST['Dienstw2']));
$Dienstt1= mysqli_real_escape_string($link,htmlspecialchars($_POST['Dienstt1']));
$Dienstt2= mysqli_real_escape_string($link,htmlspecialchars($_POST['Dienstt2']));
$stelplaats= mysqli_real_escape_string($link,htmlspecialchars($_POST['stelplaats']));

$Wissel=date('d/m/Y',strtotime($Datumw));
$Tegenprestatie=date('d/m/Y',strtotime($Datumt));
$status="Aangevraagd";
$vandaag = date("d/m/Y");
if(isset($_POST['submit']))
{
$aanvrager=$_POST['aanvrager'];
$collega=$_POST['collega'];
$stelplaats=$_POST['stelplaats'];

 if($Dienstw1 == "X" or $Dienstw1 =="T" or $Dienstw1 == "WV" or $Dienstw1 =="WV01" or $Dienstw1 =="CV" or $Dienstw1 =="CV01" or $Dienstw1 =="HU" or $Dienstw1 =="HU01" or $Dienstw1 =="AV01" or $Dienstw1 =="AV" or $Dienstw2 == "X" or $Dienstw2 =="T" or $Dienstw2 == "WV" or $Dienstw2 =="WV01        

Answers


ArrowHead February 2016

This is a common problem with FPDF library. You outputing somewhere in your script some message. "For fpdf to work properly, there cannot be any output at all beside what fpdf generates". This includes the echo, print etc statements.

See these previous examples.

FPDF error: Some data has already been output by using FPDF

FPDF error: Some data has already been output, can't send PDF

FPDF error: Some data has already been output, can't send PDF file on 000webhost

FPDF error: Some data has already been output, can't send PDF file

Post Status

Asked in February 2016
Viewed 3,358 times
Voted 14
Answered 1 times

Search




Leave an answer