简体   繁体   中英

phpdesktop-chrome - Not Working for Header in php

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)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM