rss feeds
Hey,Jeg har lavet nedstående kode udfra denne guide http://www.devshed.com/c/a/PHP/Rockin-RSS-with-PHP-on-your-HTML/ !
Men jeg kan ikke få det til at virke. Håber nogen kan hjælpe mig, med at få det til at virke.
<?php
// open a file pointer to an RSS file
$fp = fopen ("rss.xml", "w");
// Now write the header information
fwrite ($fp, "<?xml version='1.0' ?><rss version='2.0'><channel>);
fwrite ($fp, <title>k.w.andersson | wormie.dk</title>");
fwrite ($fp, "<link>http://www.wormie.dk/</link>");
fwrite ($fp, "<description>Photoblog | Tags: bw, street, nature, denmark, urban, people and more..</description>");
fwrite ($fp, "<language>en-us</language>");
fwrite ($fp, "<docs>http://www.wormie.dk/rss.xml</docs>");
$db = mysql_connect("mysql1.unoeuro.com","wormie_dk","kodeord!");
mysql_select_db("wormie_dk_db",$db);
$content_sql = "select * FROM pblog ORDER BY nr ";
$content_result = mysql_query($content_sql);
while ($content_rec = mysql_fetch_row($content_result)) {
fwrite ($pd, "<item>");
$headline = $content_rec[0];
$content_1 = substr($content_rec[1], 0, 250);
$content = strip_tags($content_1);
if (strlen($content_rec[1]) > 250) {
$content = $content . "....";
}
fwrite ($fp, "<title>$headline</title>");
fwrite ($fp, "<description>$content</description>");
$item_link = "http://www.wormie.dk/index.php?d=$content_rec[3]";
fwrite ($fp, "<link>$item_link</link>");
fwrite ($fp, "</item>");
}
fwrite ($fd, "</channel></rss>");
fclose ($fd);
?>
På forhånd tak!