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

From: Date: Fri, 24 Jun 2005 19:46:13 +0000
Subject: Re: Can't even make a simple test RSS feed
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-217569@lists.php.net to get a copy of this message
* Brian Dunning <brian@briandunning.com>: > 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@garden.org | http://vermontbotanical.org

« previous php.general (#217569) next »