homepage Welcome to WebmasterWorld Guest from 54.204.64.152
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

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




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

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




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

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




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

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]");
?>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved