June 21st, 2011, 08:18 AM
'include' and xml file in php
Hi everyone, I'm struggling to get my xml file to display correctly.
I have a standard xml file and an xslt file which puts the data in to a table.
I now need to display this inside my php web page which uses teh php include statement.
the php page uses this simple line <?php include 'summary.xml' ; ?>
When i try this i get the error Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\summary.xml on line 1
June 21st, 2011, 11:55 AM
If you don't want to execute summary.xml as PHP code then don't use include, use readfile instead. If you do want to execute summary.xml as PHP code, then you need to either disable short tags, or replace any occurrence of <? with <?php echo "<?"; ?>