Autohtml.php Class Shtml {var $ TEMPLET; VAR $ DATASOURCE; VAR $ DIR;
Var $ filename; var $ mod; var $ handle;
Function SHTML ($ filename = ") {$ this-> filename = $ filename; $ this-> mod =" wb "; $ this-> handle = false;
$ this-> templet = ""; $ this-> datasource = array (); $ this-> dir = "}
///
///
Function getMod () {return $ this-> mod;} function setmod ($ mod) {return $ this-> mod = $ mod;} function open () {if (Substr ($ this-> filename, 0, 1) == "/") $ == "filename = $ _server ['document_root']. $ this-> filename; if ($ this-> handle = fopen ($ this-> filename, $ this-> mod) Return) Return $ this-> Handle; Else Return false;} Function Close () {Return Fclose ($ this-> Handle);} Function Write ($ THIS-> Handle, $ Content);} Function Mkdir ($ cathname) {$ currentpath = ""; str_replace ("//", "/", $ PATHNAME); $ PATHARR = Split ("/", $ Pathname); if ($ PATHARR [0] == " ) // Use absolute path {$ currentpath = $ _server ['Document_Root'];} else {$ currentpath = $ _server ['Document_Root']. DIRNAME ($ _ Server ['php_self']);} for ($ I = 0 $ I
function CreateShtml () {ob_start ( "callback_CteateShtml");} function callback_CteateShtml ($ buffer) {$ page = intval (@ $ _ REQUEST [ "page"]); $ shtml = new Shtml (); $ shtml-> SetFileName ($ _Server ['Document_Root']. DirName ($ _ Server ['PHP_SELF'). "/". BaseName ($ _ server ['php_self'], ". PHP"). ($ PAGE == 0? ":" _ "Strval ($ page));" .htm "); $ html-> templet = $ buffer; $ shtml-> create (); return $ buffer;}?> // call method TESTHTHTML.PHP? PAGE = XX where? Include ("autohtml.php"); CreateShtml ();?>