Decipher Posted June 20, 2007 Share Posted June 20, 2007 Hey evryone, I am trying to create RSS Feed using PHP but when i use echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; i am getting nothing. but if i use echo "?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" it is displaying the the string any suggestio?? Quote Link to comment https://forums.phpfreaks.com/topic/56307-solved-displaying-xml-in-php/ Share on other sites More sharing options...
lupld Posted June 20, 2007 Share Posted June 20, 2007 I'd try echo '<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>'; but that's just a guess, I've never really played around with xml... and definitely not both at once... Quote Link to comment https://forums.phpfreaks.com/topic/56307-solved-displaying-xml-in-php/#findComment-278202 Share on other sites More sharing options...
Decipher Posted June 20, 2007 Author Share Posted June 20, 2007 First Line you gave it is printing but next line it is not resulting in a improper XML :-( Any more Suggestion.. I read bout rss classes also but most of the claasess are letting store the file in XML but no one displays the XML within same PHP ??? Quote Link to comment https://forums.phpfreaks.com/topic/56307-solved-displaying-xml-in-php/#findComment-278278 Share on other sites More sharing options...
ToonMariner Posted June 20, 2007 Share Posted June 20, 2007 You have short tags enabled on your server - ask them to switch it off. If they wont then you have to echo out any lne that starts with '<?' in your file. If that fails then there is something amiss with your xml file. Quote Link to comment https://forums.phpfreaks.com/topic/56307-solved-displaying-xml-in-php/#findComment-278303 Share on other sites More sharing options...
chigley Posted June 20, 2007 Share Posted June 20, 2007 echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; That is correct. View the source of the page in your browser. Quote Link to comment https://forums.phpfreaks.com/topic/56307-solved-displaying-xml-in-php/#findComment-278385 Share on other sites More sharing options...
Rojay Posted June 20, 2007 Share Posted June 20, 2007 you might also try to send the header() for the XML so your browser would recognize it unless of course your page is .xml Quote Link to comment https://forums.phpfreaks.com/topic/56307-solved-displaying-xml-in-php/#findComment-278395 Share on other sites More sharing options...
Decipher Posted June 20, 2007 Author Share Posted June 20, 2007 @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.. Quote Link to comment https://forums.phpfreaks.com/topic/56307-solved-displaying-xml-in-php/#findComment-278465 Share on other sites More sharing options...
Rojay Posted June 20, 2007 Share Posted June 20, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/56307-solved-displaying-xml-in-php/#findComment-278517 Share on other sites More sharing options...
Decipher Posted June 20, 2007 Author Share Posted June 20, 2007 Yups Rojay Setting Headers worked for me... Thanks... Quote Link to comment https://forums.phpfreaks.com/topic/56307-solved-displaying-xml-in-php/#findComment-278739 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.