1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2006
    Rep Power

    '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

    any ideas?
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Rep Power
    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 "<?"; ?>

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo