mkosmosports Posted June 22, 2007 Share Posted June 22, 2007 Hey, Ive just got on my newly acquired hosting account and am starting to discover and modify things. One thing I did is modify .htaccess to allow me to parse for php code inside html files. However, now, the xml declaration is being read as php: <?xml version="1.0" encoding="UTF-8"?> and returns a php error... How can I get around this? Thanks Link to comment https://forums.phpfreaks.com/topic/56758-xml-declaration-read-as-php/ Share on other sites More sharing options...
chigley Posted June 22, 2007 Share Posted June 22, 2007 Either disable short-tags on your server (with php.ini) or use this workaround: <?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?\n"; ?> <rest> <of> <xml> <stuff> <here!> Link to comment https://forums.phpfreaks.com/topic/56758-xml-declaration-read-as-php/#findComment-280303 Share on other sites More sharing options...
mkosmosports Posted June 22, 2007 Author Share Posted June 22, 2007 Thanks chigley. I was considering the echo, which is probably what I will end up doing. The server is shared so I cant modify php.ini, do you think its worth it to try to disable short tags in htaccess? Link to comment https://forums.phpfreaks.com/topic/56758-xml-declaration-read-as-php/#findComment-280312 Share on other sites More sharing options...
chigley Posted June 22, 2007 Share Posted June 22, 2007 ini_set() is also an option.. Link to comment https://forums.phpfreaks.com/topic/56758-xml-declaration-read-as-php/#findComment-280314 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.