You can use code like the following to display a feed
<?php
$code = $HTTP_GET_VARS['e'];
//if($code == "");
// $code = php;
$xmlfile = fopen("http://www.programmershelp.co.uk/rss2.php?e=$code", "r");
if(!$xmlfile)die("cannot open the xml file");
$readfile = fread($xmlfile ,40000);
$searchfile = eregi("<item>(.*)</item>", $readfile ,$arrayreg);
$filechunks = explode("<item>", $arrayreg[0]);
$count = count($filechunks);
echo "<table border='1'>";
for($i=1 ; $i<=$count-1 ;$i++)
{
ereg("<title>(.*)</title>",$filechunks[$i], $title);
ereg("<link>(.*)</link>",$filechunks[$i], $links);
ereg("<description>(.*)</description",$filechunks[$i],$desc);
echo "<tr><td>";
echo "<a target='_new' href ='$links[1]'\>$title[1]</a><br>";
echo $desc[1];
echo "</td></tr>";
}
echo "</table>";
?>
If you call the above example testrss.php then testrss.php?e=vb will display the Visual Basic category or you can harcode the links above individually.
|