Re: How to redirect the output of a .php to a file on the webserver?
| From: | Leonardo Dias | Date: | Wed, 29 Nov 2000 14:18:05 +0000 |
| Subject: | Re: How to redirect the output of a .php to a file on the webserver? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27815@lists.php.net to get a copy of this message | ||
John van Terheijden wrote:
>
> Hi there..
>
> I use PHP to insert the content of a database into a HTML-file. This is done
> every time a page is requested.
>
> Now, what I would like is, to only do this when the content changes. So,
> when the content changes, I would like to call the .php that uses that
> content and redirect its output to a file, instead of a browser.
>
> something like "mypage.php > mypage.html" would be perfect.. but how?
>
> A second option would be something like fwrite(exec(webpagina.php)); but i
> guess that wouldn't work with a .php as argument.
>
> A third (and nasty) solution would be to fwrite() all html content and
> fwrite() the database stuff in stead of echo-ing it.
>
> Anyone?
>
> Thanks.
Check the PHP Output Buffering functions.
http://php.net/ob_start, for instance. It should solve your
problems.
:-)
--
Leonardo Dias
Analista Programador / Analyst Programmer
Catho Online
www.catho.com.br