You are here:  » How do I do this ?


How do I do this ?

Submitted by Neil on Mon, 2005-12-19 17:00 in

Hi all,

Heres my problem, I want a certain amount of news topics from a rss feed show on a page,
works well in mozilla, but the dreaded IE don`t like it, could someone please tell me where i`m going wrong, heres the code,I am new to php, so apoligies beforehand for not knowing to much about this language. As you can see rss_item is a css class which gives font, colour etc. IE wont pick it up as a href link ?

<?php
  
  
require("MagicParser.php");
  print 
"<ul id='rss_items' >";
  function 
myRecordHandler($item)
  {
    print 
"<li class='rss_item' <a class='rss_item' href='".$item["LINK"]."'>".$item["TITLE"]."</a></li>";
  }
 print 
"</ul>";
 
$url "http://http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml";
 
MagicParser_parse($url,"myRecordHandler","xml|RSS/CHANNEL/ITEM/");  
 
?>

Thanks,
Neil

Submitted by support on Mon, 2005-12-19 17:02

Hi Neil,

It may be a cut'n'paste error, but I notice that your opening <li> is not closed...! You have:

print "<li class='rss_item' <a class='rss_item' href='".$item["LINK"]."'>".$item["TITLE"]."</a></li>";
missing > here ------------^

Try this with the close angle bracket added:

print "<li class='rss_item'><a class='rss_item' href='".$item["LINK"]."'>".$item["TITLE"]."</a></li>";

...see if that makes a difference...

Submitted by Neil on Mon, 2005-12-19 17:14

Thank yo so much,

How you spot things like that amazes me

(ooops, I just edited the wrong post and deleted most of your message.. sorry!!)

Submitted by support on Mon, 2005-12-19 17:22

Too many hours hacking PHP and HTML I guess :)

PS - I notice there is also a double http:// in your $url variable...

Submitted by Neil on Tue, 2005-12-20 00:27

Dave,

Brilliant script, works a treat, and if you like we`ll link to you,
or you want to keep it a secret ? :O)