Re: Writing static file from dynamic PHP page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Chris Bruce <chris@xxxxxxxxxxxx>:
> I am looking for a way to write to a file what the browser would see 
> (raw html) when viewing a dynamic PHP page. I have numerous include 
> files, MySQL db queries, loops etc. and I want to generate the static 
> result of that file and save it as an html page. I have toyed a little 
> with output buffering to no avail.

The key to doing this sort of thing is to *NOT* echo everything as you
receive it. Store content in variables and echo once you've finished.

If this is not an option, I've seen any number of good threads on using
output buffering in recent weeks on this list; peruse them, see what has
worked for others, and try those methods; if they don't work, ask the
list for help -- and include that information (what you tried, what you
expected, what you received).

If it *is* an option, Cache_Lite from PEAR is an excellent class for
doing exactly what you're trying to do.

-- 
Matthew Weier O'Phinney           | mailto:matthew@xxxxxxxxxx
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux