0

I have a PHP file and whenever running a file in PHP phpdesktop-chrome (APP) I am getting below and I have only the following code in my file.

header("Content-Type: application/xls");
header("Content-Disposition: attachment; filename=filename.xls");
header("Pragma: no-cache");
header("Expires: 0");

Following is my error code.

Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\abc\www\backend\check.php:2)
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\abc\www\backend\check.php:3)
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\abc\www\backend\check.php:4)
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\abc\www\backend\check.php:5)
Samson
  • 352
  • 1
  • 11

1 Answers1

1

Try to insert ob_start(); after the first <?php opening tag.

Tom
  • 4,070
  • 4
  • 22
  • 50