Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-13-2007, 04:55 PM   #1 (permalink)
talismon
Junior Member
 
Join Date: Oct 2007
Posts: 4
Default rss feed

how do i/where can i find out how to put an rss feed php style onto my website?
talismon is offline   Reply With Quote
Sponsored Links
Old 11-14-2007, 12:22 AM   #2 (permalink)
camp185
Junior Member
 
camp185's Avatar
 
Join Date: Nov 2007
Location: San Jose, CA
Posts: 12
Send a message via Yahoo to camp185
Default Re: rss feed

Not sure what you mean, but I have a rss feed that automatically updates every hour by grabbing the new content from a database. I have a cron file tell a php file to write an rss file. I can help you set one up for $50.

Here is a link to it in action: New Polls on APC

I can also make it so you just manually enter data, and when you submit it automatically writes a new rss file.
camp185 is offline   Reply With Quote
Old 11-20-2007, 08:35 AM   #3 (permalink)
etono
Moderator
 
Join Date: May 2006
Posts: 86
Default Re: rss feed

You can go about it with two different techniques.

Output XML by having your feed be called like http://example.com/rss.php

You will want to add a header before you output any data so that your php file will be treated as an xml file. Your script will start with something like this:
header("Content-type: text/xml");
echo '<?xml version="1.0"?>';

The other preferred way is to actually create an example file that would be called like http://example.com/rss.xml. This is preferred as some RSS readers will not recognize the .php extension. To create the file just make sure your rss.xml file is writable, once again you will start off like this:

$rss = <?xml version="1.0"?>';
//Finish your complete RSS file here
if(is_writable('rss.xml')){
if(!$handle = fopen('rss.xml', 'w')){
echo "Unable to open or create RSS file";
exit();
}
if(fwrite($handle, $rss) === false){
echo "Unable to write to RSS file";
exit();
}
echo "You successfully created the RSS file
fclose($handle);
}

Hope this helps to get you started.
__________________
Jeremy Moseley
My Links: Design Related Blog | Personal Website | Portfolio
etono is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 10:48 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums