Code:
<?
//Do not edit the following, it's compul
// sory
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
//Enter your website URL below
$site = "http://www.gfy.com/";
//Map the directory that this file is in
//
map(".", $site);
//Map a higher directory such as yoursit
// e.com/articles/old/
map("articles/old", $site);
//Do not edit the function below
function map($dir, $site){
$dir = opendir($dir);
while(($file = readdir($dir)) !hahahaha false)
{
if($file != "."){
if($file != ".."){
//Make sure were only outputing file's a
// nd not directories
if(strpos($file, ".") != ""){
echo "<url>$site$file</url>\r\n";
}
}
}
}
closedir($dir);
}
echo "</urlset>";
?>
drop in server run