|
Posted by KiwiBrian on 05/28/05 00:30
"Chris Hope" <blackhole@electrictoolbox.com> wrote in message
news:d72peg$3n1$1@lust.ihug.co.nz...
> KiwiBrian wrote:
>
>> I would like to create once a week, 7 pages, one for each day of the
>> following week, with just the page of the day accessible from a common
>> link. For example "Click here for the program of the day".
>> Can this functionality be implemented so that the link gets changed
>> automatically for each day, thus meaning that I can set it up for the
>> week and forget it until next week?
>
> Yes.
>
>> I am not a programmer, but am reasonably familiar with HTML and CSS.
>> I have been advised that this would be relatively trivial to implement
>> in PHP, which my server supports.
>> If so, where would I look on the web for such a script and how to
>> implement it?
>
> The date() function can be used to determine what the current day is and
> then it would be a simple matter of doing an if-then or switch
> statement to create the link.
>
> An easier way of doing it would be to just name the page names after the
> day of the week and then your link would look something like this:
>
> <a href="<?php echo date('l') ?>.php">blah blah blah</a>
>
> If today is Monday the link above would look like this in the outputted
> html:
>
> <a href="Monday.php">blah blah blah</a>
>
> If you wanted to make it all lower case (ie "monday" instead of
> "Monday") then do this:
>
> <a href="<?php echo strtolower(date('l')) ?>.php">blah blah blah</a>
>
I am trying to implement the above advice but have a few basic queries.
1. If I place the above link in any page on my site, (which I understand
supports php located anywhere within the site) and a normal html page named
Saturday.php in the root directory, should it be implemented by the link?
Does it need a path specified?
2. Is there anything special to php that I need to have implemented that I
may not be aware of as I have no php experience?
3. If I wanted the page Saturday.php to be located in the same directory as
the calling hyperlink how do I include the path in the hyperlink?
Hopefully these may identify what I need to know to progress the project.
TIA
Brian Tozer
[Back to original message]
|