Output to browser failing

Topics: User Forum
Sep 30, 2010 at 7:21 PM

So I have been searching and reading on here for 2 hours and tried was feels like everything to get my file to output to the browser with no luck.  If you go here, www.barriemenshockey.com/nick/make-ref-schedule.php?month=10, you can see the crazy character output I am getting.

To get some out of the way, I do not have any white space in front of my <? or any behind the ?>.  I have no echo statements in my code.  This is what I have at the bottom of my script:

//redirect output to client browser
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="refschedule-'.strtolower($txt['months'][$month]).'.xls"');
header('Cache-Control: max-age=0');

$objWriter = PHPExcel_IOFactory::createWriter($pe, 'Excel5');
$objWriter->save('php://output');

The wierd thing is that on my local testing server it outputs to the browser fine with no errors at all and the file looks right.  I am running xampp on my testing computer.  But when I upload it to my web server I get the pile of mess.  Any help would be great.  Thanks for your time.

Nick 

Coordinator
Oct 1, 2010 at 2:01 PM

I've tried following your link, but I get a completely blank page (no crazy characters at all), and firebug doesn't even show any response headers. Content length returned is 0 with a (default) content type of text/html..