Results 1 to 7 of 7

Thread: Rotating Websites

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    HondaForums.com
    Posts
    11

    Arrow Rotating Websites

    I am looking for a javascript solution for rotating websites.
    When a visitor comes to my domain www.somewhere.com, I want the first page to automatically forward the visitor to another site. But I want this to rotate to 5 or 6 different sites evenly.
    for example:
    1st visitor comes to www.somewhere.com and is redirected immediately to www.somewherelse.com.
    2nd visitor comes to www.somewhere.com and is redirected immediately to www.anotherurl.com.
    and so forth...
    If this can't be done in javascript, is there another way it can be done?

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    You could redirect with Javascript randomly or perhaps by time of day or something. The problem is you would have no way of knowing what they were redirected to. To do what you want, you will need to process this on the server, using you & your server's technology of choice (ASP, PHP, Perl, etc.)
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3
    scoutt
    Guest
    you can accomplish a redirection through META tags, but you are limited to how many sites you can redirect to. one I think. I agree with JoshT about useing a different language (ASP, PHP, CGI, PERL) those would probably be your best bet

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    HondaForums.com
    Posts
    11
    So if I used something like this that JoshT suggested...

    <%
    If Session("RotateCount") = 0 Then
    Response.Redirect("www.site1.com")
    Session("RotateCount") = 1
    ElseIf ...
    ...

    Could somebody please finish this code and do I need to use a database or something to store the variables?
    I am new to VB and Asp so please bear with me...
    Thanks...

  5. #5
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    Does it have to be in that order? Or can it be random?

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    HondaForums.com
    Posts
    11
    It would be better if it was in order. That way I know that the sites are getting an even number of hits. I know you can do this with PHP and perl but I want to know if it is possible to do it with ASP and vbscript. Will it work by placing the URL's in a database and running a loop through the fields and increasing a record count or something like that. I am not familiar with how to do any of this but any help would be greatly appreciated.

  7. #7
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    This should work for 3 sites. Just increase the numbers to add more:

    Code:
    If (Session("RotateCount") = 0) Or (Session("RotateCount") = "") Then 
    Response.Redirect("www.site1.com") 
    Session("RotateCount") = 1 
    ElseIf Session("RotateCount") = 1 Then 
    Response.Redirect("www.site2.com") 
    Session("RotateCount") = 2 
    ElseIf Session("RotateCount") = 2 Then 
    Response.Redirect("www.site3.com") 
    Session("RotateCount") = 0
    End If
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

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



Click Here to Expand Forum to Full Width