I've been playing with the FPDF module. I was building a form and rolling right along and then suddenly I started getting the "FPDF error: Some data has already been output, can't send PDF file" error when trying to view the page I'm building.
It had been working fine until I converted my structure data into an array for cleaner coding. I'd alresdy been using an array to draw my lines, so I knw that the use of an array isn't the issue in itself.
I know that this error has to do with headers, but I can't figure out where the issue is developing. How can I go about finding out where the issue is? When I first tested a sample FPFD script I got this error and discovered that I had inadvertently put a couple spaces in front of the <?PHP bracket. It worked fine after removing the spaces.
I experienced some issues with my editor between the time itwas working and when it wasn't. I'm wondering if it's possible that something got corrupted. The document outputs to file without issue - just having trouble displaying the document on the browser.
For what it's worth, here's my code:
Code:
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/lib/fpdf/fpdf.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/pe_lib/pe.inc.php';
$pdf=new FPDF();
// front page
$pdf->AddPage();
//draw lines
$fp_lines = array();
$fp_lines = get_fplines();
for ($ctr=0;$ctr<=count($fp_lines);$ctr++ ){
$pdf->Line($fp_lines[$ctr]['x1'], $fp_lines[$ctr]['y1'], $fp_lines[$ctr]['x2'],$fp_lines[$ctr]['y2']);
}
//add boiler plate
$fp_bp=array();
$fp_bp = get_fpbp();
for ($ctr=0;$ctr<=count($fp_bp);$ctr++){
$pdf->SetFont($fp_bp[$ctr]['font'],$fp_bp[$ctr]['font_type'], $fp_bp[$ctr]['font_size']);
$pdf->SetXY($fp_bp[$ctr]['x'], $fp_bp[$ctr]['y']);
$pdf->Write(5,$fp_bp[$ctr]['text']);
}
$pdf->Output($_SERVER['DOCUMENT_ROOT']. '/pdf_docs/test2.pdf',"F");
$pdf->Output();
?>
How to create a static html menu from a database
Hi,I have built a small cms which allows me to create simple html pages and then upload them to an ftp.Everything is working apart from the menu, I cant get my head round how to create the menu
strptime() equivalent for php4 ?!
Greetings!this is my first post, thank you in advance for your replies. Well, the title says it all, is there an equivalent of the function strptime() for php4 ? I want to parse a timestamp like this
TemplatePower & AJAX
Hi all,I'm currently implementing some AJAX features in my PHP-framework (which is based on TemplatePower) and I have encountered a problem:I have a block which holds a message-div. This block is
SESSION CHECK WORKS "MOST" of the time... whats going on?
i have a sign in check thats included in every page that is a members only page which is basically all of my pages. that im working on anyways..but heres the code..... that works MOST of the time.
Transform value 0 in no and 1 in yes help needed
Hello,I have this in the table: "value" type int 0 to represent false and 1 to represent true. everything works great in display to the user end it sees 0 or 1 i want to replace the 0 to
System copy error in RUN ABAP REPORT PHASE
Hi,
Captcha problem users just refresh and it will let them auto submit again
Users will just re submit and not have to enter the new captcha.. ? Lol but if i refresh the page, the captcha auto makes a new1 so u cant submit.But if u enter captcha code alrdy, then submit form
quick basic question, hopefully not dumb
I don't know how to search for this, so forgive me if it's been covered...I often see an example like this:$a = $b . " " . $c; // concatenate strings with spaceI'm wondering if there is
Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing, yahoo, etc) but not AOL. Here's the code that doesn't' work. Can anyone help?else if
Issues: PHP Forms -Clearing
I've tried looking online before actually asking for help, but I've been looking for about the past 3-5 hours and have found nothing that'll help me.This is a project for school, and well I have to