Change the httphandlers using php

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
etorvinen
-


Joined: 02 Jan 2005
Posts: 31

PostPosted: Tue Oct 24, 2006 10:02 pm    Post subject: Change the httphandlers using php Reply with quote

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 View user's profile Send private message
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Wed Oct 25, 2006 6:51 am    Post subject: Reply with quote

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 View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group