Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP Weather RSS Script

    I'm making this script which reads of the BBC RSS weather. Unfortunatly it currently isnt displaying anything. Have I got my nodes mixed up or somthing?

    <?php

    function xml_via_proxy ($url) {
    $context = stream_context_create(
    array('http'=>
    array('proxy'=>'cache.uwe.ac.uk:8080')
    ));

    $contents = file_get_contents($url, false, $context);
    return simplexml_load_string($contents);

    };

    $weather = xml_via_proxy("http://feeds.bbc.co.uk/weather/feeds/rss/5day/world/0105.xml");

    $description = $weather->rss->channel->item->description;


    ?>
    <table border="1">
    <h1>EALA</h1>
    <tr><td>Description</td><td><?php print $description ?></td></tr>

    </table>

  • #2
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I wish i had php 5 to use functions like that

  • #3
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dont wish to much, remmber this isnt working....
    Thanks for bumping the thread anyway.

  • #4
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Problem solved, just remove the rss->

    Sometimes I really hate xml


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •