RE: [PHP-DB] Excel headers not working anymore
| From: | Fire Marshal's Office) | Date: | Fri, 11 Feb 2005 19:37:03 +0000 |
| Subject: | RE: [PHP-DB] Excel headers not working anymore | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-38562@lists.php.net to get a copy of this message | ||
Wow!
Removing the file that controlled the session array fixed the problem
(suggestion 2).
I was using ssl and session data and would never have guessed it would trip
things up. I would have stared at this problem for weeks and probably not
have solved the problem.
Also I will change my code to include <?php instead of <? from now on just
to be sure.
Thank you very much for your help.
- Matthew Perry
-----Original Message-----
From: Martin Norland [mailto:martin.norland@stjude.org]
Sent: Friday, February 11, 2005 10:47 AM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Excel headers not working anymore
Perry, Matthew (Fire Marshal's Office) wrote:
> Good morning,
>
> I have been using PHP4.1, Apache, and MySQL for a few years now and have
> never had a problem with my Excel headers. When I want to output html to
> Excel I place the following on the top of the page:
>
> <?header ("Content-type: application/vnd.ms-excel");
> header ("Content-Disposition: attachment" );
>
> After moving to PHP 4.3, MS SQL Server, Windows 2000 Server I am having
> problems with this header. I get the message:
> "Internet Explorer cannot download myfile.php from myintranet.net"
1) is your server still configured to recognize "<?" as php (and only
php)? You may want to make that "<?php" to be more sure. The headers
likely aren't being sent if it's prompting to download .php - seems like
it's not recognizing the extension, perhaps it's disabled for a certain
pattern.
You could also try changing it to:
header("Content-disposition: attachment; filename=\"$filename\"");
to ensure that it's "going off" (set $filename obviously, something
distinct like my_excel.xls)
2) Are you using ssl and sessions? You'll find some fun and strange
behavior trying to save output from an ssl connection and sessions -
because sessions force no-cache, and (IE in particular) has real issues
with storing the output of a no-cache'd https - you can't save it
locally or open with an external application, because either way it has
to store it somewhere other than memory, which would be caching.
Cheers,
--
- Martin Norland, Sys Admin / Database / Web Developer, International
Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php