A little help please?

Discussion in 'XML & RSS' started by sabian1982, Jan 26, 2007.

  1. #1
    Im trying to set up Magpie RSS to run (eventually on the index page of my directory).

    So far im just having problems getting it running on a test page let alone my directory!!!

    I have got the following code:

    
    
    <?php require_once('rss/rss_fetch.inc');
    $rss = fetch_rss('http://newsrss.bbc.co.uk/rss/newsplayer_uk_edition/sci-tech/rss.xml');
    echo "<a href=".$rss->channel['link']."><b>".$rss->channel['title']."</b></a>";
    foreach ($rss->items as $item) {        
    	$href = $item['link'];
    	$title = $item['title'];
    	$desc = $item['description'];
    	echo "
    <p><a href="$href">$title</a><br>
    ";
    	if($desc) echo $desc;}
    ?>
    
    
    Code (markup):
    This is returning the following error @ http://www.voisd.com/test.php

    I've put all four .inc and the extlib folder in a folder named rss to keep everything together (as suggested at the How To Forge Tutorial)

    Any help would be appriciated as im really not getting anywhere fast at the moment - id just love to get this up and running asap!
     
    sabian1982, Jan 26, 2007 IP
  2. joshuayip

    joshuayip Member

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Try this
    echo "<p><a href='$href'>$title</a><br>";

    instead of a double quote , which closes the php statement, upon which the compiler expects a semi colon, you should put a single quote. I am not pro. If not right dont shoot me! :p
     
    joshuayip, Jan 29, 2007 IP
  3. sabian1982

    sabian1982 Notable Member

    Messages:
    2,028
    Likes Received:
    161
    Best Answers:
    0
    Trophy Points:
    210
    #3
    Ive got it working already :) im just stuggling to get it to only show a defined number of threads... needless to say it makes the page at Voisd Webmaster Directory rather long!

    Cheers anyways!
     
    sabian1982, Jan 30, 2007 IP