How to redirect the output of a .php to a file on the webserver?
| From: | John van Terheijden | Date: | Wed, 29 Nov 2000 14:15:24 +0000 |
| Subject: | How to redirect the output of a .php to a file on the webserver? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-27814@lists.php.net to get a copy of this message | ||
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.
- John van Terheijden, the Netherlands