RSS Feeds to HTML using PHP

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I was trying to render a RSS feed using XSL.
I used the following XSL file and was successfully able to render
static XML pages.
Click the following link:
Probably this will help you out.

Now my problem arised when I tried to use PHP to do this for several
feed dynamically.
I used the same XML file. And I wrote a simple PHP code to fetch the
file and output it.
$xml  = file_get_contents(" ");
echo $xml;
And when I give the URL of this php script, mozilla firefox fails to
display it
Now, this seems just because the file extension was PHP or something
like that...
If I do a view-source for the XML file and the PHP file, they are
identical byte-by-byte.
Even IE is not displaying it properly.
Please guide.

Sometimes I feel that it is not even able to read the file XSL file
because there is no formatting at all!

Re: RSS Feeds to HTML using PHP

Rex wrote:
Quoted text here. Click to load it

One word, 'headers'. Two words, 'content-type'.

i.e. add before the echo:

header('Content-Type: text/xml');


Re: RSS Feeds to HTML using PHP

Thanks Robin!
That was the only problem!!
It shows exactly as wanted in Firefox.
IE is still crazy. I guess it fails to handle XSL roperly...
I am satisfied  with firefox.

thanks again..

Site Timeline