Been twisting and turning on this for hours now, can't figure out how to make some sense of it.
I'm working in a php file round 6000 rows...
There's multiple header() calls before my switch case header call is executed.
The header() call works if I use ob_start(); and ob_end_flush(); at the top and the bottom of the document.
For some reason I don't understand, this:
$csv = urldecode($source['csv']);
$filename = urldecode($source['file']);
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Disposition: attachment; filename=$filename");
header("Pragma: no-cache");
header("Expires: 0");
print $csv;
break;
outputs the entire html-document instead of just the $csv variable which is supposed to print and save the .csv file for the client browser.
Ideas?
Note: the call is made from a php document -> posting -> $csv and $filename , they are both $_POST[].