-----Original Message-----
Hi Everyone
Howdy.
I'm trying to get a create a form that will direct a
user to a different website everytime they enter data
into it
I.e the first visitor that fills the form would be
directed to services1.htm, second would go to
services2.htm and so on
A traffic wheel, I just dont know how to do it? Can
anyone help??
It's actually much easier to select the target site at
random. Here's an example in JavaScript:
<script>
urls = new Array("
http://www.microsoft.com",
"
http://office.microsoft.com",
"
http://www.interlacken.com");
curDate = new Date();
curTim = curDate.getTime();
urlNum = curTim % urls.length;
document.write("<a href='" + urls[urlNum] + "'>Go</a>");
</script>
You can specify as many urls as you want in the statement
that begins on line 2.
If you really need the choice of URL to be sequential, you
would need to control this on the server. In ASP, the code
would look something like this:
<%
Dim wheelCnt
Dim url
Application.Lock
If "" & Application("wheelcnt") = "" Then
wheelCnt = 0
Else
wheelCnt = Application("wheelcnt")
If wheelCnt < 2 Then
wheelCnt = wheelcnt +1
Else
wheelCnt = 0
End If
End If
Application("wheelcnt") = wheelCnt
Application.Unlock
Select case wheelCnt
Case 0
url = "
http://www.microsoft.com"
Case 1
url = "
http://office.microsoft.com"
Case Else
url = "
http://www.interlacken.com"
End Select
Response.Write "<a href=""" & url & """>Go</a>"
%>
Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------