I have a question. I have site. In one page I want put edit box with button. When user put any url to edit box and press button, site must return sitemap (like this site www.xml-sitemaps.com/). Is there a script php, which creates a sitemap based on any url? I mean create sitemap generator. My example code:
<html>
<head></head>
<body>
<form id="CreateSiteMap" method="post" action="ParseUrl.php">
<p>Input url site:</p>
<input type="text" size="40" name="URL">
<input type="submit" value="Generate">
</form>
<?php
function ParseURL($URL_SITE)
{
//Create tree of site
return array("/Contacts.html", "/FAQ.html", "/Index.html");//For example
}
if( $_POST["URL"] )
{
echo '<div id="Sitemap">';
echo 'Sitemap '.$_POST["URL"]."<p>" ;
foreach (ParseURL($_POST["URL"]) as $i => $value) {
echo $_POST["URL"].$value."<br/>";
}
echo '</p></div>';
exit();
}
?>
</body>
</html>