You are here: Re: [PHP] Can't even make a simple test RSS feed « PHP « IT news, forums, messages
Re: [PHP] Can't even make a simple test RSS feed

Posted by "Richard Lynch" on 07/01/05 04:06

On Fri, June 24, 2005 12:23 pm, Brian Dunning said:
> What am I doing wrong? This doesn't work. The browser does not even
> load the page, no error or anything:
>
> <?php
>
> echo '<?xml version="1.0"?><rss version="2.0"><channel>';
> echo '<item>';
> echo '<title>hdfghdf</title>';
> echo '<description>dfghdfh</description>';
> echo '<link>http://somelink</link>';
> echo '</item>';
> echo '</channel></rss>';
>
> ?>

Now that you've got the browsers fooled with a ".rss" extension, go back
and rip out all those silly echo statemnts :-)

More seriously, unless this was just a test to make sure PHP was "working"
you really don't even need PHP for 90% of what you typed...

:-)

I'm assuing you'll actually put more complex PHP code in there now, but I
couldn't resist.

More seriously, you probably should have some embedded newlines in there,
even for the silly example that it is.

As it stands now, your XML is one giant long line.

Maybe XML parsers don't care, but the people who have to read your script
output *DO* care.

Take care that your PHP output is readable, as well as your PHP source.

Your PHP output *IS* source, or it will be to somebody, somewhere,
someday, if your site gets any traffic at all.

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this 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

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