Først var der kun ul-punkter og jeg ændrede
$description3 = ereg_replace("</description>.*","",$description3); til
$description3 = ereg_replace("</description>.*","",description3);
Nu står der description3 ved alle links. Hvad kan der mon være galt ?
Hilsen Marco
URL:
http://kolonihaveportal.dk/rss.php
<ul>
<?php
$rdf = parse_url("
http://www.idenyt.dk/sitemap/Plantebrevkassen?v=2");
$fp = fsockopen($rdf['host'], 80, $errno, $errstr, 10);
if (!$fp) {
echo '<li><strong>RSSPROBLEM</strong></li>';
}
else {
if ($fp) {
fputs($fp, 'GET ' . $rdf['path'] . '?' . $rdf['query'] . " HTTP/1.0\r\n");
fputs($fp, 'HOST: ' . $rdf['host'] . "\r\n\r\n");
$string = '';
while(!feof($fp)) {
$pagetext = fgets($fp,300);
$string .= chop($pagetext);
}
fputs($fp, "Connection: close\r\n\r\n");
fclose($fp);
$items = explode("</item>",$string);
for ($i = 0; $i < 10; ++$i) {
$link = ereg_replace(".*<link>","",$items[$i]);
$link = ereg_replace("</link>.*","",$link);
$title2 = ereg_replace(".*<title>","",$items[$i]);
$title2 = ereg_replace("</title>.*","",$title2);
$description3 = ereg_replace(".*<description>","",$items[$i]);
$description3 = ereg_replace("</description>.*","",description3);
$link = addslashes($link);
$title2 = addslashes($title2);
$description3 = addslashes($description3);
echo '<li><a target="_blank "href="'. $link .'">'. $description3
.."</a></li>\n";
} // end for
} // end if
} // end if
?>
</ul>