I have couple of RSS feeds in my website( if you don’t know what a RSS feed is, refer to Wikipedia -http://en.wikipedia.org/wiki/RSS). One for forum and another for my blog. I wanted to display latest threads in my forum and latest blog posts in my blog in my homepage as soon as they are published. Putting them manually into my homepage would be just a pain. So I searched all over the internet to find a solution.
Actually, I found dozens of scripts to display RSS feeds in HTML pages. However some of those scripts were pretty heavy –big in size. And some were not customizable while some others added watermark to my pages which I hate to see on a professional website.
The best script I found so far is the PHP RSS Reader. You can download it here: http://www.scriptol.com/rss/rsslib.zip
The script itself is only 3.68KB in size. So even if you include the script with your pages, you won’t even feel a difference while loading your page. The complete guide to PHP RSS Reader lies here: http://www.scriptol.com/rss/rss-reader.php
But I am going to teach you the basics to include RSS feeds in your web page.
First, you can’t use PHP RSS Reader in a regular HTML page. It requires PHP page and a PHP enabled web server to function. Since most of the web hosting services support PHP, that won’t be a problem.
Copy rsslib.php to the directory where your PHP page is. Open your PHP page with a text editor(even Notepad works good).
Add the following code inside your <head> tag.
<?php
require_once($_SERVER['DOCUMENT_ROOT']."/rsslib.php");
?>
And add the following code into the place where you want to display your RSS feeds. It should be inside the <body> tag. Or you will not see them in your page.
<?php
$url= "http://feeds.feedburner.com/perfectzblog";
echo RSS_Links($url, 4);
?>
Replace http://feeds.feedburner.com/perfectzblog with the URL to your RSS feed. Most of the popular scripts let you create your own RSS feeds with ease.
See PerfectZ homepage to see how cool it can be!
Customize it according to your pages. While making modifications, you will catch more options.
