GRooVeZ Posted May 8, 2012 Share Posted May 8, 2012 hi ive been writing my own RSS feed, and after a few hours i finally got the xml string to show correctly after that i went to a rss validator, and fixed some other stuff, but now im stuck on the last 3 actually ive been to two and they both say different things http://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fwww.acidleague.com%2FLeague%2Findex_rss.php http://www.ivalidation.net/html.php?uri=http%3A%2F%2Fwww.acidleague.com%2FLeague%2Findex_rss.php this is my file <?php header("Content-Type: application/xml; charset=ISO-8859-1"); $secure = new secure(); $secure->secureGlobals(); $rssurl = 'http://www.acidleague.com/League/index_rss.php'; $rssname = 'AcID FFA RSS'; $rssdes = 'Free For All Matches Agenda'; $xml = '<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel>'; $xml.='<title>'. $rssname .'</title><description>'. $rssdes .'</description><link>'. $rssurl .'</link>'; $query_items = "SELECT id FROM ffa_matches where status=0"; $result_items = mysql_query ($query_items) or die("Query failed with error: ".mysql_error()); while($row = mysql_fetch_array($result_items)) { $result = $row[id]; $resultdate = $row[date] $matchurl = 'http://www.acidleague.com/League/ffamatch.php?match=' . $result; $xml .= '<item><title>'. $result .'</title><link>'. $matchurl .'</link><description>'. $resultdate.'</description></item>'; } $xml .= '</channel>'; $xml .= '</rss></xml>'; echo $xml; ?>[code=php:0] Quote Link to comment https://forums.phpfreaks.com/topic/262231-new-to-rss/ Share on other sites More sharing options...
GRooVeZ Posted May 8, 2012 Author Share Posted May 8, 2012 sorry cant edit my first anymore, i quoted by accident this is my most recent code <?php header("Content-Type: application/xml; charset=utf-8"); include("./includes/egl_inc.php"); $secure = new secure(); $secure->secureGlobals(); $rssurl = 'http://www.acidleague.com/League/index_rss.php'; $rssname = 'AcID FFA RSS'; $rssdes = 'Free For All Matches Agenda'; $xml = '<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel>'; $xml.='<title>'. $rssname .'</title><description>'. $rssdes .'</description><link>'. $rssurl .'</link>'; $query_items = "SELECT id,date FROM ffa_matches where status=0"; $result_items = mysql_query ($query_items) or die("Query failed with error: ".mysql_error()); while($row = mysql_fetch_array($result_items)) { $result = $row[id]; $resultdate = $row[date]; $matchurl = $row[date]; $xml .= '<item><title>'. $result .'</title><link>'. $matchurl .'</link><description>'. $resultdate.'</description></item>'; } $xml .= '</channel>'; $xml .= '</rss></xml>'; echo $xml; ?> Quote Link to comment https://forums.phpfreaks.com/topic/262231-new-to-rss/#findComment-1343853 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.