31 users online (1 members and 30 guests)  


  Results 1 to 3 of 3

Related

  1. Replies: 1
  2. Keep It Simple S****d    Forum: HTML Forum
    Replies: 3
  3. Simple Javascript Problem - I think...    Forum: Javascript Forum
    Replies: 3
  4. In need of a simple image    Forum: Barter/Trade
    Replies: 10
  1. #1
    chilu's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2007
    Posts
    5

    simple xml problem

    Hello everyone,

    Another noob problem here. I've been trying to get into some basic XML, but am already stumbling on the test example.

    The example.xml file contains:
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body>
    </note>
    and the simple.php file contains:
    Code:
    <?php
    $xml = simplexml_load_file("test.xml");
    echo $xml->getName() . "<br />";
    foreach($xml->children() as $child)
      {
      echo $child->getName() . ": " . $child . "<br />";
      }
    ?>
    After upload on to my server, when I bring up the simple.php page the page should display the following:

    note
    to: Tove
    from: Jani
    heading: Reminder
    body: Don't forget me this weekend!

    but instead I get nothing but a blank page, the source code is blank too.

    If it helps any, I tried in safari and firefox running on mac osx.

    Any help would be much appreciated.

  2. #2
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: simple xml problem

    The PHP code in your example uses PHP 5. Is that what you have on your server? If not, the code won't work.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  3. #3
    chilu's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2007
    Posts
    5

    Re: simple xml problem

    Thanks, I've have to check into that - I assumed that my provider would be running the most recent version, not a wise assumption in hindsight...



Tags for this Thread