Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall
Everyone good, I am hacklei, I play Dede time is not long, only 2 months, Dede program now use a lot of people. Because it is very easy to use, even if the novice can be used to quickly build Dede station, I would like to tell you to weave the dream of Automatic Updates the first method.
If the homepage of the website uses the CMS that supports the random call article, such as: dedecms, content is collected, and you do not have much time to update the content manually, but want to let Baidu like your website, use this small program will be quite useful and convenient to you.
The code is as follows:
<?php
Set_time_limit (0);
Your site's CMS root URL, end do not add/
$BASECMSURL = "http://www.examx.cn";
The name of the dynamic home page
$dmPageName = "index.php";
The name of the static home page
$stPageName = "index.html";
How often do you want to update the unit in seconds?
$mkTime = 3600;
Here is the code that executes
$tureStFile = DirName (__file__). /'. $stPageName;
$ftime = @filemtime ($tureStFile);
if (!file_exists ($tureStFile) | | ($ftime < Time ()-$mkTime))
{
$body = file_get_contents ($baseCmsUrl. /'. $dmPageName);
$fp = fopen ($tureStFile, ' w ');
Fwrite ($fp, $body);
Fclose ($FP);
}
?>
Save the above code as task.php
Then introduce the following JS in the static HTML end of the home page
<script language= ' javascript ' src= ' task.php ' ></script>.
The above code is available in both Dedecms and Phpcms, ECMs may not work, but it seems to have a scheduled task function, but there is no random call to the function to use this is useless.