fmwebschool.com
Top Experts [learn more]Top 4-10
webko

9743 K
bandmandq

2458 K
Genx

1525 K
4. tcmeyers
5. kbata
6. Martie
7. Hammerton
8. rrenfrow
9. bneeman
10. plegler
Welcome, Guest. Please login or register.
September 30, 2014, 08:49:33 AM

Login with username, password and session length
Search:     Advanced search
FMWebschool releases more educational FMStudio webinars - check them out here:
http://www.fmwebschool.com/webinars.php
27804 Posts in 6151 Topics by 1525 Members
Latest Member: alkyred
* Home Help Search Calendar Login Register
+  fmwebschool.com
|-+  PHP Web Publishing Technologies
| |-+  FileMaker PHP, FX.php custom web publishing
| | |-+  FPDF error: Some data has already been output to browser, can't send PDF file
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: FPDF error: Some data has already been output to browser, can't send PDF file  (Read 32336 times)
greenwich
Newbie
*
Offline Offline

Posts: 7


« on: July 15, 2008, 09:40:43 AM »

Running DW CS2 with FMWebSchool PDFModule + php/mysql

I've built a test page which successfully creates a pdf populated by data from a mysql db. The test page is simply calling the first record found. However when I add parameters to search for a specific record, the following error message is generated in the browser:

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

------------------------
Here is the code for the link to the test page:
<a href="../residential-public.php?ID=<?php echo $row_GetListings['ID']; ?>">public pdf[/url]
------------------------

------------------------
Here is the query that's been added to the test page:
mysql_select_db($database_connXXX, $connXXX);
$recordID = $_GET['ID'];
$query_GetListings = "SELECT . . .  FROM Residential, Gallery WHERE Gallery.Gallery_List = Residential.Res_List and Residential.ID = '$recordID'";
------------------------

------------------------
Here is code at the bottom of the test page:
FMWebschool_PDF("ResidentialListings.pdf","Letter","portrait","","html2fpdf");
------------------------
 Does an ID parameter have to be added to this last bit of code or is there another problem going on?

thanks,
david
Logged
Michael Petrov
Chief Software Developer
Administrator
Hero Member
*****
Offline Offline

Posts: 4286
Kudos: 15522




Applications:
« Reply #1 on: July 15, 2008, 10:24:53 AM »

Hi David,

The problem is that before you call the FPDF output function something is already sent to the browser from some other place in your code. It might be an error message but most likely some new line that slipped outside of the PHP tags somewhere. You can view the source code of your page to see what the output is.

Best Regards,
Michael Petrov
Logged

Michael Petrov,
Chief Software Developer
FMWebschool
800.353.7950
michael@fmwebschool.com
Keep up with our development, follow me on Twitter
greenwich
Newbie
*
Offline Offline

Posts: 7


« Reply #2 on: July 15, 2008, 10:49:28 AM »

Michel,

The problem has been solved simply by removing the server behavior and then re-applying it.

david

Logged
sfo
Newbie
*
Offline Offline

Posts: 1


« Reply #3 on: July 15, 2008, 10:51:29 PM »

David -
I'm a relative newbie using a different application, Moodle, with a certificate generator plugin.  However, I get the same message "FPDF error: Some data has already been output to browser, can't send PDF file".  I was intrigued with your comment (which may be completely unrelated to my problem.) But, I thought I'd ask anyway.  Could you better explain what you meant by "removing the server behavior and then re-applying it"?  Thanks.  I appreciate your response.
Bob
Logged
greenwich
Newbie
*
Offline Offline

Posts: 7


« Reply #4 on: July 16, 2008, 04:09:56 AM »

I went into the server behavior panel, selected the behavior and deleted it from the page. Saved the page and then returned to the server behavior panel, selected the behavior and reapplied it to the page.
Logged
Michael Petrov
Chief Software Developer
Administrator
Hero Member
*****
Offline Offline

Posts: 4286
Kudos: 15522




Applications:
« Reply #5 on: July 16, 2008, 10:46:02 AM »

This really isn't about server behaviours - that's actually something that's FMStudio specific. The real issue is some non-PHP HTML code that is sent to the browser before the PDF is output - this is something that cannot be done if you will be outputting a PDF or any other file. The error tells you "output started in your/filename.php:x" where x is the line number with the offending HTML code.
Logged

Michael Petrov,
Chief Software Developer
FMWebschool
800.353.7950
michael@fmwebschool.com
Keep up with our development, follow me on Twitter
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!