SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: automated link

  1. #1
    SitePoint Zealot daemon's Avatar
    Join Date
    Apr 2001
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How can I write one of those "you are being automatically directed to the next page" link that waits 2 sec and then loads another site?

  2. #2
    Gong!
    Join Date
    May 2000
    Location
    Helsinki, Finland
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by daemon
    How can I write one of those "you are being automatically directed to the next page" link that waits 2 sec and then loads another site?
    You can accomplish this either by a meta refresh tag or via Javascript.

    For example, to create a page that redirects to another page after certain time, you could create following HTML page:

    Code:
    <html>
    <head>
    <title>Redirect example</title>
    <meta http-equiv="refresh" content="5; URL=http://www.theplace.com/you/want/to/redirect/">
    </head>
    <body>
    
    You will be redirected in 5 seconds to a new page. 
    If your browser does not redirect you automatically, 
    please click here (here goes the link)
    
    </body>
    </html>
    For example, you could set your script to output following page and perhaps dynamically change the url to fit your needs to redirect the user.

    Note: it would be wise to provide a link to the page in case if the redirect fails (for a reason or another).

    Since I'm not too familiar with Javascript, I'll let somebody else to provide more exact details how to do the same with it.
    HighCheats - game cheats, codes, tips and tricks for PC and various console platforms


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
  •