|
-
May 4th, 2001, 12:25 PM
#1
Thread Starter
New Member
Rotating Websites
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.
-
May 4th, 2001, 02:53 PM
#2
Frenzied Member
Why don't you just generate a random number between 1 and 5 and that will determine which site to redirect to?
-
May 4th, 2001, 06:39 PM
#3
Thread Starter
New Member
OK, So how do I do that? I am a beginner and don't have the first clue as to what to do...
-
May 5th, 2001, 02:02 PM
#4
First you will have to have an ASP host for the page...
Code:
<%@ 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
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
|