|  | Posted by Albe on 06/14/70 11:39 
On Thu, 09 Feb 2006 10:48:35 +0200, Jasen Betts <jasen@free.net.nz> wrote:
 > On 2006-02-08, Fred Paris <nono@nono.invalid> wrote:
 >> 2)
 >> I also have a script, script.php
 >>
 >> 3)
 >> When script.php runs, I want it to run php on template.php, and write
 >> the resulting html output to a file.
 >
 > use "ob_start"(etc...) to capture output and "require" to run the
 > external
 > php script.
 
 There is another way to do it. You can eval() the code inside template.php.
 
 <?php
 $fc = file_get_contents("template.php");
 $result = eval(" ?>".$fc."<?php ");
 $fh = fopen("resultfile.html", w);
 fwrite($fh, $result);
 fclose($fh);
 ?>
  Navigation: [Reply to this message] |