Results 1 to 2 of 2

Thread: activate and deactivate

  1. #1
    Join Date
    Sep 2005
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default activate and deactivate

    Do you know of any coding that would activate and deactivate a link on
    a web page based on time of day?

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You'd need to use php if you wanted it secure/compatible, but you could try javascript as well.
    It's not that complex.
    Basically an if.

    In php, something like
    <?php
    ...
    if ($time > 1300) { echo '<a href="blah">blah</a>';}
    ?>

    Note that $time must be set to the time of day in military time for the above example to work. There's info on that kind of thing at php.net-- look at both time() and date() functions.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •