Random Server Side Includes

M

Microsoft News

Hi all,
What I would like to do is randomize which file gets used with as a server
side include. Here is what I have so far:
<%
Const Max_Number_Of_Includes = 6
Randomize
Dim intRandomNumber, strIncludeArray(10)
strIncludeArray(0) = "includefile_1.shtm"
strIncludeArray(1) = "includefile_2.shtm"
strIncludeArray(2) = "icludefile_3.shtm"
strIncludeArray(3) = "icludefile_4.shtm"
strIncludeArray(4) = "icludefile_5.shtm"
strIncludeArray(5) = "icludefile_6.shtm"
intRandomNumber = Int((Max_Number_Of_Includes * Rnd))
<!--#include file= strIncludeArray(intRandomNumber) -->
%>

The last line is where I am confused.
Any help would be appreciated.

Regards,
Steve Karnath
 
C

Chris Hohmann

Microsoft News said:
Hi all,
What I would like to do is randomize which file gets used with as a server
side include. Here is what I have so far:
<%
Const Max_Number_Of_Includes = 6
Randomize
Dim intRandomNumber, strIncludeArray(10)
strIncludeArray(0) = "includefile_1.shtm"
strIncludeArray(1) = "includefile_2.shtm"
strIncludeArray(2) = "icludefile_3.shtm"
strIncludeArray(3) = "icludefile_4.shtm"
strIncludeArray(4) = "icludefile_5.shtm"
strIncludeArray(5) = "icludefile_6.shtm"
intRandomNumber = Int((Max_Number_Of_Includes * Rnd))
<!--#include file= strIncludeArray(intRandomNumber) -->
%>

The last line is where I am confused.
Any help would be appreciated.

Regards,
Steve Karnath
http://aspfaq.com/2042
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top