Bluefish21
04-15-2004, 01:00 AM
O.k. I'm a n00b, I'll admit it right off the bat. Now that that's established, here's what I'm trying to do. I want to rotate between 2 pages depending on whether the visitor has an "odd" last number or an "even" last number, which would be dictated by a hit counter. How can I pull just the last number off of the hit counter so that I can do this? Or is this even possible? This is what I've got so far. The hit counter I grabbed from a site, so I don't know if it's alright or not.
//Hit counter
<%
fp = Server.MapPath("aspcount.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(fp)
ct = Clng(a.ReadLine)
if Session("ct") = "" then
Session("ct") = ct
ct = ct + 1
a.close
Set a = fs.CreateTextFile(fp, True)
a.WriteLine(ct)
end if
a.Close
Response.Write ct
%>
//Page determiner
<%
If number == 1, 3, 5, 7 Then
Response.Redirect("sales1.html")
Else
Response.Redirect("sales2.html")
%>
That's all I got. Also, would I put this on page such as sales.asp and have whatever link I'm using to get to that page point to the sales.asp. Yeah, I would or how would it redirect the user?
//Hit counter
<%
fp = Server.MapPath("aspcount.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(fp)
ct = Clng(a.ReadLine)
if Session("ct") = "" then
Session("ct") = ct
ct = ct + 1
a.close
Set a = fs.CreateTextFile(fp, True)
a.WriteLine(ct)
end if
a.Close
Response.Write ct
%>
//Page determiner
<%
If number == 1, 3, 5, 7 Then
Response.Redirect("sales1.html")
Else
Response.Redirect("sales2.html")
%>
That's all I got. Also, would I put this on page such as sales.asp and have whatever link I'm using to get to that page point to the sales.asp. Yeah, I would or how would it redirect the user?