Re: php > XML output in IE: no display
| From: | Patrick Sibenaler | Date: | Tue, 10 Jul 2001 09:28:56 +0000 |
| Subject: | Re: php > XML output in IE: no display | ||
| References: | 1 | Groups: | php.general php.windows |
| Request: | Send a blank email to php-general+get-57117@lists.php.net to get a copy of this message | ||
Don't ask me what I did, but same code, same server, same client
and today it works. Yes, I know there's something called a cache
that could have caused the problem, and I had also checked that.
Nevertheless, it must have been some data stuck somewhere or IE
beeing stubborn, since content changed but data the mime got
ignored completely. My hint: shut down everything. And restart
the server/client. It will work as expected...
So again: To display XML, use:
header ("Content-type: text/xml");
at the top of your script (standard mime)
If you prefer to save it, add content disposition:
header ("Content-type: text/xml");
header ("Content-disposition: attachment; filename=\"table.xml\"");
Since netscape cannot handle XML, it will save it under either
scriptname.xml or when content disposition added, table.xml and
then call IE to display it.
thanx for the quick responses people...
greets,
patrick./
Patrick Sibenaler wrote:
>
> Has anyone figured out how to trick IE into displaying an XML file
> that is produced by a PHP script (script.php) properly?
>
> What happens usually is that you send the mime 'text/xml', but IE
> still sees content as php because the script is called php. Also
> adding <Content-disposition: filename="some.xml"> to the header
> does not help and is boldly ignored by IE.
>
> Nice detail: if the url is called using Netscape, Netscape will
> save the file out to the disk, give it the suffix .xml and call
> IE which then will display content perfectly.
>
> Any hints are greatly appreciated.
>
> greets,
> patrick./