Guardian-Mage Posted February 17, 2008 Share Posted February 17, 2008 I parse all of my xhtml pages as php, because I have a lot of php in them. The problem is, to have a perfectly valid xhtml document, I need this line:<?xml version="1.0" encoding="utf-8"?> My webhosting provider has set php to accept a <? tag as php, so now my pages just come up with an error. How can I include the above line in php, can I add a line to my htaccess file or what? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted February 17, 2008 Share Posted February 17, 2008 You need to echo the line in the correct place: <?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?> Ken Quote Link to comment Share on other sites More sharing options...
Rithiur Posted February 17, 2008 Share Posted February 17, 2008 You can also disable the short tags by adding the following line to your .htaccess file in the directory php_value short_open_tag 0 Quote Link to comment Share on other sites More sharing options...
Guardian-Mage Posted February 17, 2008 Author Share Posted February 17, 2008 Thank you Ken, I don't know why I didn't think of that, and thank you Rithiur, I needed that code. Quote Link to comment 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.