Hi I'd normally start this mail with some background of what I'm doing, but to save everyone time, I'll start with the questions, and then in case anyone has alternative suggestions or workarounds, I'll fill in the what I'm doing and why... Within PHP script, is it possible to 1. capture the results of the PHP engine's processing of the current .phtml/.php file? ie. what the server will sent back to the browser. 2. manually feed a (possibly different) .phtml/.php file into the PHP parser and obtain the results of the processing? The background to this is that I'm looking at how to update a fairly large web site. The files are flat .html files without any scripting or HTML includes. They've originally been based on a number of template files, so they have a common look and feel. Now we want to change that look, but since the files have been edited by hand and Netscape/FrontPage/DreamWeaver etc, they've been mangled a fair bit and mass substitute-and-replace isn't going to work. But that's a separate issue. What I'm looking at doing is making new template files, using PHP script to output various official headers, tables of contents and footers at the bottom etc, and then making php versions of all the existing files. Since there's so many files and the headers/footers etc won't change very often, I'd like to save the web server a lot of work by pre-generating the HTML versions of the PHP files, and serving these up rather than the .phtml files. Hence the question about how to run the .phtml files through the PHP engine and capture the output. Assuming that there's direct way to do it, the workarounds I thought of are: 1. use socket()/connect()/write()/read() from within a .phtml file to connect to the web server, GET the .php file and save it. 2. compile PHP as an stand-alone executable and then run it over the files. I think this would work, but running a CGI script which runs the PHP interpreter seems unneccessarily messy. Any thoughts/ideas/suggestions? /\ndy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]