Reply to Re: RSS Feeds to HTML using PHP

Your name:

Reply:


Posted by Robin on 05/04/06 11:19

Rex wrote:
> Hi,
>
> I was trying to render a RSS feed using XSL.
> http://www.mmmec.org/portal/rss/feed5.xsl
> I used the following XSL file and was successfully able to render
> static XML pages.
> Click the following link:http://www.mmmec.org/portal/rss/test.xml
> 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.
> --------------------------------------------------------------------------------------------------------
> <?php
> $xml = file_get_contents("http://www.mmmec.org/portal/rss/test.xml");
> echo $xml;
> ?>
> --------------------------------------------------------------------------------------------------------
> And when I give the URL of this php script, mozilla firefox fails to
> display it
> formatted.
> 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!
>

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

i.e. add before the echo:

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

HTH
Robin

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация