NYCPHP Meetup

NYPHP.org

[nycphp-talk] CSV output

Mark Withington mwithington at PLMresearch.com
Mon Sep 13 01:54:32 EDT 2004


I'm getting the following error when I try to download into Excel

"Warning: Cannot add header information - headers already sent by (output
started at .../program_files/include/header.php:36) in
.../program_files/form.php on line 466"


I use a the following code to extract, format and display the information
from MySQL:


$csv = build_csv($res_contacts, $fields_labels_ar);
ob_end_clean();
header("Content-Type: text/x-csv");
header('Content-Disposition: attachment; filename="'.$table_name.'.csv"');
echo $csv;
exit;

Would have thought that ob_end_clean would have flushed the prior header.
Can anyone shed some light?

--------------------------
Mark L. Withington
PLMresearch
"eBusiness for the Midsize Enterprise"
PO Box 1354
Plymouth, MA  02362
o: 800-310-3992
f: 508-746-4973
v: 508-746-2383
m: 508-801-0181
http://www.PLMresearch.com
Netscape/AOL/MSN IM: PLMresearch
mwithington at plmresearch.com
Public Key: http://www.PLMresearch.com/keys/MLW_public_key.asc
Calendar: http://www.plmresearch.com/calendar.php



More information about the talk mailing list