Help with remote site display
Posted: Tue Dec 12, 2006 6:53 pm
Hi, I'm new to these forums and to most PHP functionality. I have done some pretty simple things up until now and have gotten a liking of the language.
Recently, I was asked to do something new, which involves RSS and feeds. I've read codes and concepts and I am beginning to understand the use of these things.
Basically I have been asked to extract the contents of a table found in a remote page and display those contents on a table on the local page. The setup is the following: there is a table at the right with news, and a link that says "Read whole article", so when you click on the link you are supposed to get the whole article on the same page but in the center table (which normally only has a "welcome" text).
I tried the following:
this piece of code is used to get the overview of the articles, where $rs gives you the title, the overview and finally the link to the whole article. However, right now as it is, this redirects you to the remote page where the whole article is, which also contains other info. I want to extract the article (found in a table) and display it in my page. What I tried to do is exactly this same thing:
where $rs2 is supposed to get the article and display the info. The method $rs->get is supposed to extract the contents of the page selected.
However, this does not work (nothing is displayed), and since I don't have much experience with RSS and feeds I'm quite lost now as to what to look for.
Any suggestions or comments? Thanks in advance.
Recently, I was asked to do something new, which involves RSS and feeds. I've read codes and concepts and I am beginning to understand the use of these things.
Basically I have been asked to extract the contents of a table found in a remote page and display those contents on a table on the local page. The setup is the following: there is a table at the right with news, and a link that says "Read whole article", so when you click on the link you are supposed to get the whole article on the same page but in the center table (which normally only has a "welcome" text).
I tried the following:
Code: Select all
//the following code is inside a for loop
$cont = '<div class="feedstory"><h3>'.$rs["items"][$i]["title"]."</h3> \n"; //$rs is an array, [items] is an array and each index is an array containing the title, the publish date, the overview of the article and the link to the whole article
$cont .= '<p align="justify"><font style="color:#ccc; font-size: 9px;">'.$rs["items"][$i]['pubDate']."</font></p>\n";
$cont .= "<p align=\"justify\">".html_entity_decode($rs["items"][$i]["description"])."</p>\n";
$cont .= "<p><a target=\"_self\" href=\"".$rs["items"][$i]["link"]."\">"._READ_WHOLE."</a></p>\n";
$cont .= "<div style=\"clear:both;\"></div>\n</div>\n\n";Code: Select all
$rs2 = $rss->get($rs["items"][$i]["link"] //$i is the index of the article selected, so I'm trying to get to the link where the whole article resides
$cont .= '<div class="feedstory"><h3>'.$rs2["items"][0]["title"]."</h3> \n";
$cont .= '<p align="justify"><font style="color:#ccc; font-size: 9px;">'.$rs2["items"][0]['pubDate']."</font></p>\n";
$cont .= "<p align=\"justify\">".html_entity_decode($rs2["items"][0]["description"])."</p>\n";
$cont .= "<div style=\"clear:both;\"></div>\n</div>\n\n";However, this does not work (nothing is displayed), and since I don't have much experience with RSS and feeds I'm quite lost now as to what to look for.
Any suggestions or comments? Thanks in advance.