I have a PHP file which echoes an XML output. However, whenever I go to view that PHP file through Firefox (I haven't tried IE or Chrome), I get a raw text output like seen in this image:
http://numberonekits.com/Screenshot.png
It seems to me that, since the file is a PHP file, Firefox interprets it as such and does not try to display it as an XML tree, despite its XML heading. I am aware that one solution would be to send the output to a separate file with a .xml extension, but I know there must be an easier way. I guess what I am really trying to find out is how to get Firefox to recognize the XML format and display it as it should. Any help is greatly appreciated.
Tell the browser you are sending it an XML file:
header('Content-Type: text/xml');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With