Timeout redirect
Results 1 to 3 of 3

Thread: Timeout redirect

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

    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,435
    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
    14,478
    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.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

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
  •