Home > Archive > PHP Language > July 2006 > loading pages based on dates
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
loading pages based on dates
|
|
|
| I want my home page to change according the the seasons.
To do this, I've created a simple index.html page that contains only PHP
code (and basic header/body structures).
The code simply compares the current date to dates signaling the change of
seasons (if...elseif...else) and when a condition is true, it loads the
appropriate page.
I'm using Include() to do this. (include 'index-summer.html')
My question is, is this the proper useage of include()? Also, is this the
best/most efficient way to be doing this?
Thanks.
Bert
| |
| Geoff Berrow 2006-06-28, 6:57 pm |
| Message-ID: <e7tsgc$ler$1@pcls4.std.com> from Bert contained the
following:
>I'm using Include() to do this. (include 'index-summer.html')
>My question is, is this the proper useage of include()?
The only drawback with that is you have to keep four pages up to date.
I prefer to have one page and only change what is necessary.
--
Geoff Berrow 0110001001101100010000000110
0011011010110110010001101111011001110010
11
1001100011011011110010111001110101011010
11
| |
|
| Geoff:
Thanks.
The site is for a little hunting lodge in the state of Maine, and there are
enough changes seasonally--but not from one year to the next, if that makes
sense--that individual pages seem easier. (And I've been known to forget to
change the page so we're looking at lovely snow scenes in June.
Well...almost...)
Thanks again.
Bert
"Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
news:fs45a2hfpo8c58ijtfsg2mlslh3ggkfqqe@
4ax.com...
> Message-ID: <e7tsgc$ler$1@pcls4.std.com> from Bert contained the
> following:
>
>
> The only drawback with that is you have to keep four pages up to date.
> I prefer to have one page and only change what is necessary.
>
> --
> Geoff Berrow 0110001001101100010000000110
> 0011011010110110010001101111011001110010
11
> 1001100011011011110010111001110101011010
11
| |
| Ørjan Langbakk 2006-06-28, 6:57 pm |
| Den 28.06.2006 14:25, skriblet Bert følgende:
> I want my home page to change according the the seasons.
> To do this, I've created a simple index.html page that contains only PHP
> code (and basic header/body structures).
> The code simply compares the current date to dates signaling the change of
> seasons (if...elseif...else) and when a condition is true, it loads the
> appropriate page.
> I'm using Include() to do this. (include 'index-summer.html')
> My question is, is this the proper useage of include()? Also, is this the
> best/most efficient way to be doing this?
The way you are doing it seems fine, but instead of changing the
_html-file_, why not only change the CSS? That will of course mean that
you have to code your HTML correctly, and use CSS for styling. That way,
all you have to change is the CSS file - you can have four of those, and
one of the index.html. (That is, of course, if the text on the page
doesn't change much, only the visuals).
--
mvh
Ørjan Langbakk
http://www.bergenpchjelp.no
http://www.cubic-design.net
| |
|
| Or even better, output the CSS via PHP. Thereby having one index and one dynamic CSS.
-Lost
|
|
|
|
|