Timeout redirect
Results 1 to 3 of 3

Thread: Timeout redirect

  1. #1
    Senior Member
    Join Date
    Apr 2005
    Posts
    1,250

    Timeout redirect

    I need a script (PHP, Javascript, AJAX i'm unsure) that after a selected time has elapsed you are redirected to another page.

    This might be 4 minutes for example?

    Also I want it to do the same thing if you are no longer logged in via a cookie? I guess this new page after 4 minutes could check for a cookie and if not redirect you but I need to know how to redirect after a time frame has elapsed first?

    Any ideas?

  2. #2
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,432
    PHP Code:
    header('Refresh: 240;url=http://yoursite.com/path/to/page'); 
    but note that the 'Refresh' header isn't part of the HTTP standard (unless that's changed recently).

    Otherwise, you could use Javascript's setTimeout() function.

  3. #3
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,985
    Or use both methods, along with a meta tag refresh as well, to cover multiple bases in the hopes that at least one method will work.
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because he’s a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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