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 Quote Link to comment 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. Quote Link to comment 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"'); Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.