|
-
May 4th, 2001, 11:15 AM
#1
Thread Starter
New Member
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?
-
May 4th, 2001, 11:35 AM
#2
Black Cat
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.
-
May 4th, 2001, 01:38 PM
#3
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
-
May 4th, 2001, 02:49 PM
#4
Thread Starter
New Member
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...
-
May 4th, 2001, 09:35 PM
#5
PowerPoster
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
-
May 5th, 2001, 11:01 AM
#6
Thread Starter
New Member
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.
-
May 7th, 2001, 09:21 AM
#7
Black Cat
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|