NO -- Use php to create the rss.xml file, by writing it to the server, as I mentioned earlier. It is a simple process.
Just name your current file rss_generator.php and put all the xml statement into a the header or content. This is what I have done... may need some debugging. This is some old code, and I took out some of it for simplicity.
PHP Code:
include_once ('connect2db.php'); // connect to the database
//Query to retrive data to update RSS and Twitter with.
$query = "SELECT Title, Author, Category, Introtext,Publish_Up, URLS, DATE_FORMAT(Publish_Up, '%a, %d %b %Y %T') AS MyDate, DATE_FORMAT(Publish_Up, '%Y-%m-%d %H:%i:%s') AS MyDate2 FROM content WHERE Priority > 0 AND Publish_Dwn > DATE_ADD(NOW(), INTERVAL 1 HOUR) ORDER BY ID DESC LIMIT 20";
//Format for Date_Format: "Fri, 28 Jul 2006 13:00 MST"
// Completed the while loop, now write footer, close the RSS file and done. if ($debug == 0 && $newestDate > $fileDate){ $fp = fopen($xmlFile, "w"); // make a new RSS file each time. fwrite($fp, $rss_header); fwrite($fp,$rssContent); fwrite($fp, $rss_footer); fclose($fp); }
// That's all folks
If you start fiddling with running xml files as php files, I assure you, you are looking for a lot of trouble.
NO -- Use php to create the rss.xml file, by writing it to the server, as I mentioned earlier. It is a simple process.
Just name your current file rss_generator.php and put all the xml statement into a the header or content. This is what I have done...
This may work if you are only generating static RSS feeds. If you plan to have RSS feeds that might be specific to users or generally need to be generated on the fly then I would suggest an rss.php that can build the rss on the fly. Then in your RSS reader you just give the URL of yoursite.com/rss.php and the RSS reader will display appropriately (it doesn't care what the "extension" is in the URL in other words).
i'm finally do it!!! I want to say all people who try to help me and answer my dumb questions thank you very much
if someone need that is my work code: this file name rss.php
Bookmarks