我一直在使用PHP脚本将数据从我的数据库(MysqL)导出到XLS文件.
虽然文件导出过程在Firefox和IE上运行良好.
尝试使用Google Chrome导出时出错.
谷歌浏览器错误是
Duplicate headers received from server
The response from the server contained duplicate headers. This problem is generally the result of a misconfigured website or proxy. Only the website or proxy administrator can fix this issue.
Error 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_disPOSITION): Multiple distinct Content-disposition headers received. This is disallowed to protect against HTTP response splitting attacks.
我需要一些帮助.
谢谢
解决方法:
我已经在PHP导出代码的标题部分找到了我的问题.错误和正确的行如下:
不正确
header("Content-disposition: attachment;filename=\"".$this->filename."\"");
正确
header("Content-disposition: attachment; filename=\"".$this->filename."\"");
希望这可以帮助.