Sunday, September 2, 2018

xml - Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/indesign/index1.php:7)








I am using MAMP and working with the xml file. I want to give a download option to download a file with option using this code:



$savefile="hello.xml";
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false); // required for certain browsers
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"" . $savefile . "\";");

header("Content-Transfer-Encoding: binary");
// header("Content-Length: " . filesize($parsed_url['localpath']));
readfile($$savefile);


It gives me this error when i run it:




Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/check/index1.php:7) in /Applications/MAMP/htdocs/check/index1.php on line 51


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...