Jump to content

[SOLVED] displaying XML in PHP


Decipher

Recommended Posts

@chigley

 

I checked the View Source in Browser

 

That is displaying the correct XML File only

Since the extension in the browser is not XML may be its stripping off the tags or....

 

@ ToonMariner

How  to disable the short tags..

 

@Rojay

 

if i try to send the header won't it will throw an errror header() already being passed..

 

 

well thats why you need to set the header the first thing

header ("content-type: text/xml");

 

try to add this before echo-ing anything

 

another thing is renaming the file to xml

 

and create ".htaccess" file and put this in it

 

<Files ~ "^[^\.]+$"> 
SetHandler application/x-httpd-php 
</Files> 
AddHandler application/x-httpd-php .xml

but all the xml files in this directory will be treated as php files

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.