-
-
- /**
- Create directory
- */
- function makedir($mudir)
- {
- $file = "./$mudir";
- @mkdir($file,0777 );
- }
/**
- Create the sub-template file path first
- */
- 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);
- }
/**
- Update respective sub-template files //$modfile is the name of the sub-template
- */
- function writeweb($content,$web,$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"already exists";
- }
- $d="{content6}"; / /Updated content
- $dd="";//Content to be updated//Content to be updated
- @writeweb($d,$dd,$ff);
- ?>
-
Copy code
Articles you may be interested in:
Three methods and code details for generating static pages in PHP
Example of php generating static page function (php2html)
Reference on how to generate html static pages with php
A class written in php to generate static pages
Code to generate html static pages from all content in the database
How to automatically generate static pages on a virtual host at regular intervals
Detailed tutorial on generating static pages with php
Solution to the problem that pseudo-static pages cannot be accessed in apache
Code written by php about spider crawling records of static pages
How to generate static pages using smarty
How to generate static pages with PHP
Solution to the problem that apache cannot access pseudo-static pages
|