This is a discussion on loading pages based on dates within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I want my home page to change according the the seasons. To do this, I've created a simple index....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 001101101011011001000110111101100111001011 100110001101101111001011100111010101101011 |
|
|||
|
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: > >>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 > 001101101011011001000110111101100111001011 > 100110001101101111001011100111010101101011 |
|
|||
|
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 |