Results 1 to 5 of 5

Thread: A time out link

  1. #1
    Join Date
    Nov 2007
    Location
    Michigan
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default A time out link

    Hi,
    I am looking for what would more than likely be simple code for some one that knows html. I have just never had the time to learn much. A good share of my work on our site has been to modify others or letting front page do the work.
    What I am looking for is a page that would time out at a date and time and then jump to a second page. So when some one clicked the link after "time out" they would be sent to the second page only.
    Any ideas?

    R.T.

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

    Default

    Find the time with your language [see below], then redirect to the second page if it is after that time.

    Javascript:
    Not secure and could be bypassed, but doesn't require a server side language to be installed on the server. It would also work live, for a page already loaded.
    Basically, if the current time is greater than the set time, switch the document.location to your next page.

    PHP:
    Same idea, but this is server side (or you could use ASP, etc., too). You need it installed on your server, though.
    This would redirect instead of loading the page if it was after the time. Completely secure, too.
    You'd still need javascript for a page that has already been loaded to redirect, though.
    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

  3. #3
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Well, the complications of this are that your time is different, server time, your local time, my local time, GMT/UTC etc. all different. SO if you have a page expire on Thursday of next week, some will have it expire 47 hours before/after others.

    If this isn't a concern, then converting the date to expire into a day, month and year and giving a header Location can be done in PHP:

    PHP Code:
    <?php
    if (date("m") >= 11 && date("d") >= 17 && date("Y") >=2007header('Location: http://www.example.com/newpage.html');
    ?>
    or... something like that..
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  4. #4
    Join Date
    Nov 2007
    Location
    Michigan
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks Blizzard. That code should do the job. Correct, if our site was for World wide, time would be a problem. But it is really for a local membership, so we will all have the same time.

    R.T.

  5. #5
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Okay, but still be careful of Server time vs. your local time. You may have to adjust if your on one coast and your server is on another (like mine)
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

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
  •