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 Quote 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!> Quote 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? Quote 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.. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.