View previous topic :: View next topic |
Author |
Message |
etorvinen -
Joined: 02 Jan 2005 Posts: 31
|
Posted: Tue Oct 24, 2006 10:02 pm Post subject: Change the httphandlers using php |
|
|
Was tring to create a rss news feed. connecting to a mysql database.
I need to change the header to:
Code: |
<?php
header("Content-Type: application/xml; charset=utf-8");
?>
|
is that correct?
i am getting an Parse error: parse error, unexpected T_STRING _________________ ;@ |
|
Back to top |
|
|
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Wed Oct 25, 2006 6:51 am Post subject: |
|
|
I wrote a small script which I still use to serve all my bookmarks in Firefox so I allways have them on all my computers.
Quote: | <?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<?php
foreach(explode("\n", implode("", file("rss.txt"))) as $key => $content) {
$db = explode("|", $content);
$a = $db[0];
$b = $db[1];
if ($a != "" && $b != "") {
?>
<item>
<title><![CDATA[<?php echo $a ?>]]></title>
<link><![CDATA[<?php echo $b ?>]]></link>
</item>
<?php
}
}
?>
</channel>
</rss> |
|
|
Back to top |
|
|
|