PDA

Click to See Complete Forum and Search --> : Rotating Websites


DeadlyDrew
May 4th, 2001, 12:25 PM
I am looking for a vbscript 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...
I don't know much about vb or vbscript or asp but if I can get some script and possible direction I can probably figure it out.

seoptimizer2001
May 4th, 2001, 02:53 PM
Why don't you just generate a random number between 1 and 5 and that will determine which site to redirect to?

DeadlyDrew
May 4th, 2001, 06:39 PM
OK, So how do I do that? I am a beginner and don't have the first clue as to what to do...

chenko
May 5th, 2001, 02:02 PM
First you will have to have an ASP host for the page...


<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<BODY>
<%
Dim iRndNumber
iRndNumber = Int(Rnd * 6) + 1 '
Select Case iRndNumber
Case 1
Response.Redirect("http://www.site1.com")
Case 2
Response.Redirect("http://www.site2.com")
Case 3
Response.Redirect("http://www.site3.com")
Case 4
Response.Redirect("http://www.site4.com")
Case 5
Response.Redirect("http://www.site5.com")
Case 6
Response.Redirect("http://www.site6.com")
End Select
%>
</BODY>
</HTML>


that will do it for you.

si