Google|sitemap
put the following code as a php file, upload the site root directory, run once, and get the URLs under the root directory.txt that can be used as your site's sitemaps submitted to google!
Note: Change the URL in the code to your home page
/***********************************************************************/
/* */
* Author:cnphper * *
* HomePage:www.cnphper.com * *
* email:phforum@163.com * *
* qq:1984412 * *
/* */
/***********************************************************************/
Set_time_limit (0);
$dir = "./";
$yoursite = ' Yoursite"; Here, change the address to your home page
Get_dir ($dir);
function Get_dir ($dir)
{
if (Is_dir ($dir))
{
if ($dh = Opendir ($dir))
{
while (($file = Readdir ($DH))!== false)
{
if ($file!= '. ' && $file!= ' ... ')
{
if (Is_dir ($dir.) /". $file))
{
if ($dir = = './')
{
$curdir = "./ }
else
{
$curdir = "./". substr ($dir, 2). " / }
get_dir ($curdir);
}
else
{
$currentdir = substr ($dir, 1);
if ($currentdir == ')
{
$currentdir = "";
}
$fileextension = get_extension ($file);
$fp = fopen (' urls.txt ', ' A + ');
$txt = $yoursite. $currentdir. " /". $file." lastmod=2005-10-19 changefreq=weekly priority=0.5n ";
Fwrite ($fp, $txt);
Fclose ($FP);
}
}
}
Closedir ($DH);
}
}
}
function Get_extension ($file)
{
$temp = Explode ('. ', $file);
$exten = count ($temp)-1;
return $temp [$exten];
}