PHP execution in xml

Discussion in 'Apache' started by ShadowDragon, Jan 24, 2006.

  1. #1
    I have been trying for the last couple of hours (with no progress) to get Apache to execute php code in a .xml file. Does anyone have any suggestions on this? Thanks!

    Apache/2.0.55, PHP 4.4.0-pl1-gentoo
     
    ShadowDragon, Jan 24, 2006 IP
  2. dave487

    dave487 Peon

    Messages:
    701
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What exactly is the problem?

    You will need the following headers in the file:

    header('Content-type: text/xml');
    echo "<" . "?" . "xml version=\"1.0\" encoding=\"ISO-8859-1\"" . "?" . ">";
     
    dave487, Jan 24, 2006 IP
  3. ShadowDragon

    ShadowDragon Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You're right, I forgot to include the content type in my .php, so I was trying to just get a .xml to work. Thanks!
     
    ShadowDragon, Jan 24, 2006 IP
  4. dave487

    dave487 Peon

    Messages:
    701
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #4
    No probs, its often not mentioned when you look at tutorials about this stuff.
     
    dave487, Jan 24, 2006 IP