Re: Can't even make a simple test RSS feed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Brian Dunning <brian@xxxxxxxxxxxxxxxx>:
> 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>';
>
> ?>

You need to add the following before echoing anything:

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

-- 
Matthew Weier O'Phinney           | WEBSITES:
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org
mailto:matthew@xxxxxxxxxx         | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux