This is really pretty easy in ASP or any other server-side language.  Copy and paste the below code into your favorite text editor, and save it as, say, Rotate.asp.  It will rotate through the 5 pages listed every 10 seconds, switching pages each time.  If you want more pages, less pages, or different reload times, just read through the code comments and make the tweaks below, or holler and I can help you.
 
 
<%
'Brent Ozar 4/15/2005
'Cheap & easy way to rotate between pages
If Session("Counter") = "" then
     Session("Counter") = 1
ElseIf Session("Counter") >= 5 then
     'That above Session("Counter") >= 5 check should be
     'the number of pages you're rotating through.
     Session("Counter") = 1
Else
     Session("Counter") = Session("Counter") + 1
end if
 
Dim strURL
'Below, you put your list of pages.  If you want more,
'copy/paste in more lines.
Select Case Session("Counter")
     Case 1 strURL = "http://www.yahoo.com/"
     Case 2 strURL = "http://www.cnn.com/"
     Case 3 strURL = "http://www.woodstone.nu/"
     Case 4 strURL = "http://www.brentozar.com/"
     Case 5 strURL = "http://www.penny-arcade.com/view.php3"
     Case else strURL = "Whoops!  Check the counter variable in line 6."
end select
         
'In the below line, note the CONTENT=""10"".  That's the number of
'seconds that the page will wait before reloading.
Response.Write("<html><head><META HTTP-EQUIV=""Refresh"" CONTENT=""10"">")
Response.Write("</head><body><p>Displaying: " & strURL & "</p>")
Response.Write("<iframe src=""" & strURL & """ WIDTH=600 HEIGHT=600></IFRAME>")
%>
 
 
 
 
------------
Brent Ozar - UniFocus
UF Customer of the Week:
------------
"Now I like nothing better than a pretty girl's smile
 And I hadn't seen a smile that pretty in a while..."
           Beastie Boys, She's Crafty
 

Reply via email to