Welcome to WebmasterWorld Guest from 54.146.240.181

Forum Moderators: bill & werty

Message Too Old, No Replies

How do you turn a text file or php file in to a RSS file?

     

Jesse_Smith

9:36 am on Dec 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How do you turn this code in to a RSS file, with out .htaccess? The <head> stuff isn't doing it, and what's the code for a php version of this?

<HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/xml; charset=UTF-8"></HEAD>

<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="word/1.5.2" -->
<rss version="2.0">
<channel>
<title>The title</title>
<link>http:-/www.url.com</link>
<description>The description.</description>
<generator>URL</generator>
<item>
<title>Title text</title>
</item>
</channel>
</rss>

Jesse_Smith

10:16 am on Dec 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I got the php version made....

<?

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

?>

<!-- generator="wordpress/1.5.2" -->
<rss version="2.0">
<channel>
<title>title</title>
<link>http-//url.com/blog</link>
<description>Description</description>
<generator>http-://url.org/</generator>
<item>
<title>title</title>
</item>
</channel>
</rss>

Just need to figure out how to use

<HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/xml; charset=UTF-8"></HEAD>

to turn a file in to text/xml

encyclo

5:04 pm on Dec 2, 2005 (gmt 0)

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You should be using the mime type
application/rss+xml
rather than the older
text/xml
for the feed. For the charset, the default for XML is UTF-8 (and you have declared it in the XML prolog anyway) but you can define UTF-8 specifically with a header like this:

<?php
header("Content-type: [b]application/rss+xml; charset=UTF-8[/b]");
?>
 

Featured Threads

Hot Threads This Week

Hot Threads This Month