When I run this script I made, it produces all the data (URLs, last modified date, etc) but it does not look like a standard XML feed. Is there something I've overlooked? I want to make a dynamic Sitemap so that Google always has the full list of all my dynamic content.
Thanks!!
PHP Code:<?php
include 'db.inc.php';
print ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
print ("<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">");
$getTestimonials = "SELECT tID, date from testimonies where approved ='Yes' order by date desc limit 15";
$result = mysql_query ($getTestimonials) OR die(mysql_error());
if ($row = mysql_fetch_array($result)) {
print ("<urlset>\n");
do {
$tID = $row["tID"];
$date = $row["date"];
$date = date("D, d M Y H:i:s \G\M\T");
print ("\n\n<url>\n");
print ("<loc>http://www.oil-testimonials.com/essential-oils/$tID</loc>\n");
print ("<lastmod>$date</lastmod>\n");
print ("<changefreq>yearly</changefreq>\n");
print ("</url>\n");
} while($row = mysql_fetch_array($result));
print ("</urlset>\n");
} else {print "Sorry, no testimonials were found!";}
?>







Bookmarks