I modified this code a little to better learn PHP (I\'m a PHP newbie). Since I currently have each datafeed source in a separate table in my database, I can add a ?x=tablename to pull a feed from that table instead of from the database in general. The description area is modified to work with CSV files from Shareasale, but you could just replace the table names with those from your network.
<?php
// Some RSS readers don\'t like certain characters in the text so this function will replace them with HTML entities
function escape_upper_chars($text) {
// 32-90, 97-122
for ($x = 0; $x < strlen($text); $x++) {
$w = $text{$x};
if ((ord($w) < 32) || ((ord($w) > 90) && (ord($w) < 97)) || (ord($w) > 122)) {
$q .= \'&#\'.ord($w).\';\';
} else {
$q .= $w;
}
}
return $q;
}
$x = mysql_real_escape_string($_GET[x]);
if(!$x) { $x = \'exampletablename\'; }
header(\"Content-type: text/xml\");
// Send the header data
echo \"<?xml version=\\"1.0\\"?><!DOCTYPE rss SYSTEM \\"http://my.netscape.com/publish/formats/rss-0.91.dtd\\">
<rss version=\\"0.91\\">