BackDoor- Door 1
You find yourself in a strange house with only a man on the phone as a guide.
4.08 / 5.00 28,329 ViewsMini Commando
Action adventure game with nazi enemies in the second world war.
3.89 / 5.00 24,756 Viewselbekko wanted this so here it is:
rss.php
<?
header("Content-type: text/xml"); //Set the header to XML.
$data = mysql_connect("localhost", "username", "password");
mysql_select_db ("RSSdb"); //Connect to your database.
?>
<rss version="2.0">
<channel>
<title>News</title> // Your RSS title
<description>Latest News</description> // Description of RSS
<link>http://www.yoursite.com</link> // And link to your website.
<?
$query = "SELECT * FROM news ORDER BY id DESC LIMIT 5";//Orders 5 news posts by post id.
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){ //Set up a while loop
?>
<item>
<title><?=$row['title']; ?></title>
<author><?=$row['author']; ?></author>
<link>http://www.yoursite.com/viewNews.php
?id=<?=$row['id']; ?></link>
</item>
<?
}
echo '</channel>\n</rss>';
mysql_close($data);
?>
Now we include the RSS on your page with this code:
<link rel="alternate" type="application/rss+xml" title="News" href="http://www.yoursite.com/rss.php" />
RSS is pretty simple and easy to get the hang of once you grasp the concepts of XML.
Huh? Did I ask for this? =/ That's a new one, I made my own RSS script a loooooong time ago :p
"My software never has bugs. It just develops random features. " - Unknown
[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]
A little comment: this will NOT work on hosts who have short tags disabled.
"My software never has bugs. It just develops random features. " - Unknown
[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]
A bug in the last lines:
It goes:
echo "</channel>\n</rss>";
Not:
echo '</channel>\n</rss>';
Since single quotes won't convert \n (newlines).