When using "pdft.php" for generating a PDF sent to directly to the client's browser, I got the following errormessage:
[SOLUTION]Some data has already been output, can't send PDF file
In order to see that the database connection was working properly, I output the connection identifier string (e.g. "echo $conn;").
BUT: Nothing (absolutely NOTHING) must be output when generating the PDF See: http://www.id.unizh.ch/cl/zinfo/fpdf/tutorial/tuto1.htm
Where the last paragraph says:
So I removed this single "echo" line and things finally worked!Caution: in case when the PDF is sent to the browser, nothing else must be output, not before nor after (the least space or carriage return matters). If you send some data before, you will get the error message: "Some data has already been output to browser, can't send PDF file". If you send after, your browser may display a blank page.