Tips Station Asp.net Article Seo Articles
Tutorials Code Samples
›  Home
›  Mission
›  About us
›  Contact Us
›  Feedback
›  Terms & Condition
Asp Articles
IT Solutions
 
› ASP.NET

› Programming Tips

› Ajax

› Asp

› ADO.NET

› Databases

› SEO

› CSS And Designing

› Php

 
Most Viewed Articles
 
› Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

› Change theme dynamically without page refresh in ASP.NET

› Install AJAX On Machines Running Visual Studio 2005

› Creating Pretty Popups Using AJAX

› Simple ASP Image Resize Function

› SQL Server Performance Counters

› ASP.Net Interview Questions And Their Answers

› Encode Url using ASP

› Difference Between DataGrid and GridView in Asp.Net

› Select Specific Value WithIn Drop Down List Or Radio Button List

more...
 
 
Home> Php
 
Make An RSS Feed Using PHP
 

Ok you start off with just finding out the basic structure of a RSS feed channel. So you still have to include title, link, and description to each item you would like to display in your feed.

So the best way to learn how a RSS feed works is by looking at one and seeing were everything should go so take a look at the code below we provided for you and you can understand how it all works.

<?xml version='1.0'?>
<rss version='2.0'>
<channel>
<title>Websites Tittle/Name</title>
<link>Websites full URL</link>
<description>Website description</description>
<language>en-us</language>

<item>
<title>Items Title</title>
<link>Items URL goes here</link>
<description>Items description here</description>
</item>

</channel>
</rss>

Then once you have worked our how the basics of an RSS feed works we then will have to open up a new black page and start loop some PHP coding into it so it will then pick up our database information.

So I have broken the code up for you so I can also explain each step and what parts you have to change.

<?php
$connection = mysql_connect("localhost",
"db_accountname",
"password");
mysql_select_db("db_name", $connection);

Above we have started with connecting to the database. You will have to edit 3 areas in here, the db_accountname, password and db_name.

Then we move onto the SQL query and how many items we would like to display with putting the command ‘LIMIT 10’. You can change this to as much as you would like your feed to show.

$select = "SELECT * FROM db_tablesnamehere ORDER BY id DESC LIMIT 10";
$query = mysql_query($select) or die(mysql_error());

And now we will finish off the code with all the page information. This part it pretty easy so just copy this code below and edit all the areas such as the title, link and description. Also remember don’t forget to keep the $ in front of the database areas or it wont be able to pick up the information.

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

echo "<?xml version='1.0'?>
<rss version='2.0'>
<channel>
<title>Websites Tittle/Name</title>
<link>Websites full URL</link>
<description>Website description</description>
<language>en-us</language>";

while($array = mysql_fetch_array($query)){
extract($array);
$content = htmlentities($content);
echo "<item>
<title>$titlehere</title>
<link>$urlhere</link>
<description>$descriptionhere</description>
</item>";
}
echo "</channel></rss>";
?>

When just save this file as a PHP formal and upload it.

 
 
Vrp Technologies
 
Serversea Hosting
 
 
Latest Articles
 
› Sending SMS With PHP

› MySQL Join Tutorial

› Make An RSS Feed Using PHP

› Intro To Object: Option Variables

› Design An Online Chat Room With PHP And MySQL

› Create Tell A Friend Script With HTML & PHP

› Benchmark And Optimize PHP Script Speed

› What Kind of DBA Are You?

› SQL Server Performance Counters

› SQL Server Performance Tips

more...
 
Random Articles
 
› Cascading Stylesheets Advantages: 5 Reasons To Use CSS

› Create Tell A Friend Script With HTML & PHP

› Create an RSS Feed in Asp.net

› What Are Active Server Pages (ASP)?

› What SEO Tricks Must I Avoid When Optimizing My Pages?

› Access Master Page controls from the Content Page - Asp.net

› Add a Confirmation popup to a Button in Asp.Net

› Dynamically Generating Thumbnail Images in ASP.NET

› Search Engine Optimization & Submission Strategies - A Beginners Guide

› How to modify expire date of a cookie using Asp

more...
 
Home Mission About us Contact us Feedback Terms Conditions
2008 © Copyright TipsStation. All rights reserved.