Jump to content


rss feed


2 replies to this topic

#1 venomsnake

    Jedi In Training

  • Members
  • PipPip
  • 481 posts
  • Gender:Male

Posted 06 November 2005 - 07:34 PM

i trying to create a rss feed, and i want to add php to it so it can take info from the database, but its not working, ex: http://gamingreloaded.com/rss2.php

<?php
include("dbconnect.php"); 
$title = "$row[title]";
$link = "http://gamingreloaded.com";
$desc = "$row[newstext]";
mysql_query("SELECT * FROM news LIMIT 0,10");
while($row = mysql_fetch_array($data)) {
echo '
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Gaming Reloaded News</title>
<link>http://www.gamingreloaded.com/</link>
<description>Gamingreloaded.com Latest news</description>
<author>venomsnake@gamingreloaded.com</author>
<language>en-us</language>
</channel>
<item>
<title>$title</title>
<link>$link</link>
<description>$desc</description>
</item>
</rss>';
?>

anyone know how to fix it?

Edited by venomsnake, 06 November 2005 - 09:40 PM.


#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 06 November 2005 - 08:46 PM

Rename the file to .php, then add
header('Content-type: text/xml');
To the top of the script (in the php tags).


-moved to proper category...

#3 venomsnake

    Jedi In Training

  • Members
  • PipPip
  • 481 posts
  • Gender:Male

Posted 06 November 2005 - 09:31 PM

i got it working now, thanks.

but when i have it on the google personalized home for the rss feed, it shows the title, but unlike on the other rss feeds i have, like p2l, there is no edit button to show the amount and it says Information is temporarily unavailable.

edit: and for some reason, the link for the title, on google its gamingreloaded.com.com which is from when i screwed up the link, but i fixed it and its not fixing on the google thing

edit2: i just tried it on a different rss reader, and it works fine, so google is being screwy :(

edit3: ok its fully working now :yoda:

so many edits... lol

Edited by venomsnake, 06 November 2005 - 10:34 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users