Create an RSS feed with linked links

Edit: I have this line:

$comments = "http://www.kiubbo.com/index.php?action=comments&param=".$articles[$index]->getId();

      

And if I put it here, it works in the title tag, but not in the link or guid tags.

fwrite ($fp, "<item>\n");
fwrite ($fp, " <title>$title</title>\n");
fwrite ($fp, " <link>$comments</link>\n");
fwrite ($fp, "<guid>$comments</guid>\n");
fwrite ($fp, "</item>\n");
}
fwrite ($fp, "</channel></rss>\n");
fclose ($fp);

      

For some reason it takes out the "& param" part of the link ($ comments).

Thanks everyone.

0


a source to share


3 answers


Perhaps your parser was unable to correct the error correctly. You, for example, did not escape your ampersands. Ask Feed Validator what is wrong.



If you want to write XML file, use XML tool, do not separate lines.

+1


a source


If I understood you correctly and want a link to the comments:

$comments = "YOUR_WEBSITE_HERE/index.php?action=comments&param=".$articles[$index]->getId();

      

you should probably also use <link rel="replies"

for reference, everyone loves semantics!



Hope it helps,

Phil

+1


a source


Good thing I was wrong, I had to change &

to &amp;

.

0


a source







All Articles