Re: Static Pages with PHP
| From: | Richard Lynch | Date: | Mon, 20 Nov 2006 22:14:47 +0000 |
| Subject: | Re: Static Pages with PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244899@lists.php.net to get a copy of this message | ||
On Sun, November 19, 2006 10:50 pm, John Comerford wrote:
> I am new to PHP and I am looking at mixing dynamic and static pages to
> build my web application. I have a situation where, depending on some
> parameters I will display a static page from within my PHP code. My
> question is, is there a 'trick' to doing this or do I just read in the
> file and echo it out again ?
http://php.net/readfile
this is good for small files
For monster large files, you probably want to fopen/fread in a loop.
You might be able to rig things so that you are linking to a true
static page when you need it.
But you're only looking at a minor performance penalty for running it
through PHP. (Like maybe 5%) So unless your running some sort of
millions of hits a minute site, it's probably better to just keep it
simple and do a readfile() or fread() loop.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?