Re: Using PHP to generate HTML
| From: | Graeme Merrall | Date: | Wed, 21 Jun 2000 04:45:13 +0000 |
| Subject: | Re: Using PHP to generate HTML | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-532@lists.php.net to get a copy of this message | ||
Beau Hartshorne wrote:
>
> Hi,
>
> I am developing a backend MySQL/PHP solution for a client to update a news
> section on their front page. To avoid unnecessary overhead, I do not want my
> front page to be running SQL queries each time a someone visits the site.
> Instead, I would like my client to be able to click on a "Publish Page"
> button in the backend that would automatically create a static index.html
> file. The client would click on this "Publish Page" button after they had
> finished updating/editing the news items.
>
> So, is there a way to write the result of a PHP/MySQL query to a static web
> page at the client's command?
Yep,
Simply set up an admin page that queries the DB, which then uses fopen()
to open the file and write the content. You can play round with header
and footer includes to save on writing text to the file stream.
Cheers,
Graeme