Control link availability by date and time

Waubain

New Member
I teach and have a website with links to multiple lessons. Each lesson is for a different weeks activities. I want control availability of each lesson link by date and time. I have been doing this manually in HTML each week but would like to automate this if possible. I know a little about HTML, CSS, Javascript, and PHP in the order of most to least.

I Googled without success. If anyone knows of any tutorial pertaining to this topic or where to start I would appreciate it.

Thanks.
 

adamk9

New Member
Personally, I would use PHP. I would make it so if the current date is past the availability date, then then link should be shown, otherwise just show text. the code could be something like this.

PHP:
<?php
     $date = date("Ymd");
     if ($date >= "20110507") {
          echo "<a href=''>Link</a>\n";
     } else {
          echo "Link\n";
     }
?>
the function above will show the link if the current day (on the server running the php code) is on or past 2011-05-07 where 05 is the month. to read up on the date function, go to http://php.net/manual/en/function.date.php
 

Sandy4ebraham

New Member
I teach and have a website with links to multiple lessons. Each lesson is for a different weeks activities. I want control availability of each lesson link by date and time. I have been doing this manually in HTML each week but would like to automate this if possible. I know a little about HTML, CSS, Javascript, and PHP in the order of most to least.

I Googled without success. If anyone knows of any tutorial pertaining to this topic or where to start I would appreciate it.

Thanks.

For that you can use the Datepicker control that will easily get the current date and time to you.

In HTML and IN .Net and java everywhere you can use the Datepicker.
 
w3schools.com.. that is the website my teacher used as a reference when she taught us web design.. she taught us about those languages in that order, too..
 
Top