probypro7 Posted April 24, 2007 Share Posted April 24, 2007 Hi All... I have problem about header. My code is about export mySql data to Excel header("Content-Type: application/vnd.ms-excel; name='excel'"); header("Content-disposition: attachment; filename=".date("YmdHis").".xls"); In FireFox everithing is OK but in IE cannot. I have try it at my local server with IE is OK but in real server (online) this code not work properly. Somebody know the problem? please help me! Thanks, Best regards, Gede Link to comment https://forums.phpfreaks.com/topic/48388-internet-explorer-cannot-read-header-information/ Share on other sites More sharing options...
btherl Posted April 24, 2007 Share Posted April 24, 2007 Try using the Live HTTP Headers firefox extension to capture the headers for both your local and online server, and look for differences. If possible, use something similar for IE. Sometimes an apache setting (such as mod_gzip) will cause different headers to come out. Quoting the filename may help too.. who knows? Headers are always messy to deal with. Link to comment https://forums.phpfreaks.com/topic/48388-internet-explorer-cannot-read-header-information/#findComment-236616 Share on other sites More sharing options...
Glyde Posted April 24, 2007 Share Posted April 24, 2007 For backwards compatibility with all browsers, the filename attribute of the Content-disposition header should be contained in double quotes. header("Content-Type: application/vnd.ms-excel;"); header('Content-disposition: attachment; filename="'.date("YmdHis").'.xls"'); Link to comment https://forums.phpfreaks.com/topic/48388-internet-explorer-cannot-read-header-information/#findComment-236631 Share on other sites More sharing options...
probypro7 Posted April 24, 2007 Author Share Posted April 24, 2007 Try using the Live HTTP Headers firefox extension to capture the headers for both your local and online server, and look for differences. If possible, use something similar for IE. Sometimes an apache setting (such as mod_gzip) will cause different headers to come out. Quoting the filename may help too.. who knows? Headers are always messy to deal with. Can you help me to explain Live HTTP Headers? I am newbie for this. Thanks a lot Link to comment https://forums.phpfreaks.com/topic/48388-internet-explorer-cannot-read-header-information/#findComment-236731 Share on other sites More sharing options...
probypro7 Posted April 24, 2007 Author Share Posted April 24, 2007 For backwards compatibility with all browsers, the filename attribute of the Content-disposition header should be contained in double quotes. header("Content-Type: application/vnd.ms-excel;"); header('Content-disposition: attachment; filename="'.date("YmdHis").'.xls"'); Thanks Glyde, I already try it but Not Solve yet. Link to comment https://forums.phpfreaks.com/topic/48388-internet-explorer-cannot-read-header-information/#findComment-236732 Share on other sites More sharing options...
Glyde Posted April 24, 2007 Share Posted April 24, 2007 Try running the headers through print() instead of header() so you can see exactly what is being sent to the browser. Link to comment https://forums.phpfreaks.com/topic/48388-internet-explorer-cannot-read-header-information/#findComment-237533 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.