
| 歡迎訪問全國企業網站設計NO.1網站開發商平臺 | 付款方式 |
POST TIME:2020-10-09
set_time_limit(0);
//你網站的CMS根網址,結束不要加 /
$baseCmsUrl = http://www.bnxb.com;
//動態主頁的名稱
$dmPageName = "index.php";
//靜態主頁的名稱
$stPageName = "index.html";
//你希望多長時間更新一次,單位是秒
$mkTime = 3600;
//下面是執行的代碼
$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);
}
?>
|