復制代碼 代碼如下:<?
function makedir($mudir) //創建目錄
{
$file = "./$mudir";
@mkdir($file,0777);
}
function writemod($filemodname) //先創子摸板文件路徑
{
$fp=fopen("showmod.shtml","r");
$str=fread($fp,filesize("showmod.shtml"));
fclose($fp);
$fp=fopen($filemodname,"w");
fwrite($fp,$str);
fclose($fp);
}
function writeweb($content,$web,$modfile) //更新各自的子摸板文件//$modfile是子摸板名字
{
$fp=fopen($modfile,"r");
$str=fread($fp,filesize($modfile));
$str=str_replace($content,$web,$str);
fclose($fp);
$fp = fopen($modfile,"w");
fwrite($fp,$str);
fclose($fp);
}
$m = "00000";
makedir($m);
$ff = $m."/0001.shtml";
if(!file_exists($ff))
{
writemod($ff);
}
else
{
echo"已經存在";
}
$d="{content6}"; //被更新的內容
$dd="";//要更新的內容//要更新的內容
@writeweb($d,$dd,$ff);
?>