RSS Feed - RMB Scripting
You appear not have have an account with us, Click HERE to register an account...
RMB Scripting
Navigation
  Home
  Contact
  FAQ
  Forum
  Topsites
  Members
  Affiliates
  Arcade <-- New!
  IoxHost
Downloads
  Templates
  Scripts
  Fonts
  Image Sets
  Software
  Other
 
Tutorials
  .htaccess
  Photoshop
  C/C++
  CSS
  Macromedia Flash
  MySQL
  PHP
  PHP - User System
  HTML
  Javascript
  Macintosh
  Macromedia Fireworks
  Visual Basic
  Visual C#
  Windows
  Python
  Other
 
Latest Tutorials
All PHP / Apache Funct...
Block User\'s Direct A...
Generate a salt
Image Tag Tracking
Cpanel/webmail Login
Latest Comments
Friendlist/Blocklist +...
Friendlist/Blocklist +...
Friendlist/Blocklist +...
Steal msn picture
Simple and minimalisti...
Stats
Total Members: 562 [216]
Total Tutorials: 269
Newsest User: Stf
Todays Unique Hits: 48
Users Online: 0
 
5 Guests
Poll
Should we change our name?
Hmmmm, Yes!!
Maybe
Depends on what to
NO!
Main Content
Tutorial: RSS Feed By ShadowMage
This will be a continuation of: http://rmb-scripting.com/tutorials.php?tutorial&tid=21

Now first off, create a new file and anme it rss.php or what ever you want.

When you are finished open it up and type up something like the following:
   
PHP:

<?php
header
('Content-type: text/xml'); //change file type to XML
include("db.php");  //get config
?>
<rss version="2.0">
<channel>
    <title>Feed Name</title>
    <description>Feed Descriptiondescription>
    <link>http://yoursite.com</link>
<?
$result 
mysql_query("SELECT * FROM entries ORDER BY id DESC"); //get the information
while($row mysql_fetch_assoc($result)){ //repeat the info
?>
<item>
     <title><?=$row['title']; //echo the title
?></title>
     <description><?=$row[short]; //echo the content
?></description>
     <author>SiteName submissions@yoursite.com</author>
     <link>http://yoursite.com/index.php?id=<?=$row['id']; //another link to the article
?></link>
     <guid>http://yoursite.com/#<?=$row[id];// Quick Link
?></guid>
</item>
<?
//end the while
?>
</channel>
</rss>


Be sure to change all your variables and upon checking it with W3C Feed Validator it is valid.

For a live example you can see mine at:
http://hrwp.exofire.net/hrwp_new/rss.php

Now you have to edit your .htaccess file =P

Please add the code below so that instead of rss.php you could use news.xml or something else.

   
CODE:

RewriteEngine On
RewriteRule ^(.*).xml$ rss.php


You can have anything with the extension of .xml which will link up to your news rss file!
Difficulty: Moderate
Views: 1250
Rating:
Comments
Posted on Thursday 18th October 2007 at 09:55 PM
Arudis
omg iv been looking all over the internet for a guide like this thanks
Notice:
Remember to post long codes on our pastbin! - (http://rmb.pastebin.com/)
Add Comment
You must be logged in to post a comment.
Good Morning Guest
Username: 
Password: 
Remember Username
Links
RMB Arcade
$2.50 Resellers
Free Domains
Free Games
Affiliates