😕
I know I've sent the headers to THIS page (at least, I think so; the code opens, reads, and modifies a mysql database. I then write to a file using php. Now, following that, I'd like to call the following:
define('FPDF_FONTPATH','font/');
require_once('html2fpdf.php');
$pdf = new HTML2FPDF('P', 'mm', 'Letter');
$pdf->AddPage();
$fp = fopen("test.html","r");
$strContent = fread($fp, filesize("test.html"));
fclose($fp);
$pdf->WriteHTML($strContent);
$pdf->Output($ft, 'D');
... which is the code that generates the pdf file. However, because the headers are sent, fpdf (which is called by html2fpdf) generates the error. There MUST be SOME way around this. I've tried putting the above code in a file and including it, but the headers are still sent. How do I close down the current headers session? Can I close the current window and open a new one? If so, what's the code to do it? Thanks for your help.