I came up with a PHP version of a sitemap file for my dynamic site which only has index.php. Here is the result: http://www.oddsnavigator.eu/sitemap.php
Now I need a way to either export those results to sitemap.xml file, or to make this one XML and Google-friendly. Here’s the code:
<?PHP
$SQL="boring query";
$num_rows = mysql_num_rows(mysql_query($SQL));
echo $num_rows , "</BR>";
$result = mysql_query($SQL);
if($result === FALSE) { die(mysql_error());}
while($db_field=mysql_fetch_assoc($result)) {
$goto = "http://oddsnavigator.eu/?display=0&sport=" . $db_field['sportid'] . "&day=all&league=" . $db_field['stageid'];
$title = $db_field['sportname'] . " " . $db_field['tempname'] . " " . $db_field['stagename'] . " Sports Betting Odds Comparison - OddsNavigator.eu";
echo "<a href='$goto' title='$title'>" , $db_field['sportname'] , " " , $db_field['tempname'] , " " , $db_field['stagename'] , "</a>" , "</BR>";
}
?>
Any ideas?
In Your code
$gotocontains URLs, store all these url in an array called $urls and then use following function.I expect the code goes in
class, if not replace$this->variablewith$variable.