Copy codeThe Code is as follows: <?
Function makedir ($ mudir) // create a directory
{
$ File = "./$ mudir ";
@ Mkdir ($ file, 0777 );
}
Function writemod ($ filemodname) // first create the path of the Child touch board File
{
$ 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) // update the respective sub-board file // $ modfile is the sub-board name
{
$ 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 );
}
USD m = "00000 ";
Makedir ($ m );
$ Ff = $ m. "/0001.shtml ";
If (! File_exists ($ ff ))
{
Writemod ($ ff );
}
Else
{
Echo "already exists ";
}
$ D = "{content6}"; // updated content
$ Dd = ""; // the content to be updated
@ Writeweb ($ d, $ dd, $ ff );
?>