RE: [PHP] **** Converting dynamic webpages into static HTML pages
| From: | Ron Stagg | Date: | Wed, 27 Nov 2002 20:29:30 +0000 |
| Subject: | RE: [PHP] **** Converting dynamic webpages into static HTML pages | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-126351@lists.php.net to get a copy of this message | ||
Thank you! This is just what I was looking for. I was not aware of the
output control functions. Using the ob_ functions will make this
child's play.
Thanks again,
Ron
-----Original Message-----
From: Michael Hazelden [mailto:michael.hazelden@ocado.com]
Sent: Wednesday, November 27, 2002 12:29 PM
To: Ron Stagg
Subject: RE: [PHP] **** Converting dynamic webpages into static HTML
pages
While this does involve the creation of a second script - it's only a
small
change:
do an Ob_start at the beginning of the script ...
Then use ob_get_contents to output to a file at the end ...
Two or three commands (including the fopen) which you'd have to add ...
How's that?
Michael.
-----Original Message-----
From: Ron Stagg [mailto:ron@trilogystudios.com]
Sent: 27 November 2002 19:19
To: php-general@lists.php.net
Subject: [PHP] **** Converting dynamic webpages into static HTML pages
I have an interesting challenge. I have built an online product catalog
that is driven entirely by the contents of the product database (MySQL).
The entire catalog is implemented in a single PHP script (catalog.php).
The dynamic nature of this implementation allows the catalog script to
generate hundreds of product description pages.
Now, my client has requested that I give him the ability to generate a
static version of the catalog so that he can burn it onto a CD for
distribution at trade shows. He wants the CD to be a snapshot of the
catalog. Furthermore, he wants to be able to generate this "snapshot"
frequently so that pricing info on the CD will be current. To
accommodate this, the process for generating the snapshot must be easy
and intuitive.
My plan of attack is to generate static HTML files by running the
catalog script once for each product in the database. Here is my
quandary; instead of echoing the output to a buffer for Apache to send
off to the client, I need the script to output to a file. I do not want
to write a second version of catalog.php that writes everything to file.
There must be an easier way to do this. Is there a way I can access the
output buffer that Apache sends to the client?
Any other ideas?
Thanks,
Ron
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Control Centre.
This message has been checked for all known viruses by the MessageLabs
Virus Control Centre.
*********************************************************************
Notice: This email is confidential and may contain copyright material
of Ocado Limited (the "Company"). Opinions and views expressed in this
message may not necessarily reflect the opinions and views of the
Company.
If you are not the intended recipient, please notify us immediately and
delete all copies of this message. Please note that it is your
responsibility to scan this message for viruses.
Company reg. no. 3875000. Swallowdale Lane, Hemel Hempstead HP2 7PY
*********************************************************************