PDA

View Full Version : XHTML not working in .php file


developer
07-18-2007, 12:26 PM
I received an error when i use xhtml standard in .php file.
can anybody help.

error occured on this line

<?xml version="1.0"?>

may be that the php tags also start with <? and ends with ?>

but if i remove his line the design becomes disturbed. what can i do?

Bill Posters
07-18-2007, 12:33 PM
Sounds as though your host server probably has short_open_tag set to on - i.e. to allow the use of short open tags.

Your options
(less ideal, imo):
You'll need to echo out the XML 'prologue' at the start of every XML doc that you intend to route through the PHP parser.

e.g.
<?= '<?xml version="1.0"?>' ?>
<!-- the rest of your XMl doc... -->

(preferable, imo)
Change your short_open_tag setting to off* and use both PHP and XML without having to work around tag conflicts.
(* Talk to your server admin.)