Hello everyone, I would like to modify the code below to bring in and randomly order 6 individual server side includes instead of the 6 tables shown below - is this possible and if so can someone offer some help on this please? <% Dim Quote(6) Quote(0) = "<table width='90' border='1' cellspacing='0' cellpadding='0'><tr><td bgcolor='#FF4500'> </td></tr></table>" Quote(1) = "<table width='90' border='1' cellspacing='0' cellpadding='0'><tr><td bgcolor='#336699'> </td></tr></table>" Quote(2) = "<table width='90' border='1' cellspacing='0' cellpadding='0'><tr><td bgcolor='#111111'> </td></tr></table>" Quote(3) = "<table width='90' border='1' cellspacing='0' cellpadding='0'><tr><td bgcolor='#556699'> </td></tr></table>" Quote(4) = "<table width='90' border='1' cellspacing='0' cellpadding='0'><tr><td bgcolor='#999999'> </td></tr></table>" Quote(5) = "<table width='90' border='1' cellspacing='0' cellpadding='0'><tr><td bgcolor='#444444'> </td></tr></table>" QuoteList = "" NumList = "|" Randomize For x = 0 to 5 'get random number RndQuote = Int(Rnd * 6) Do Until Instr(Cstr(NumList),Cstr("|" & RndQuote & "|")) = 0 RndQuote = Int(Rnd * 6) Loop NumList = NumList & RndQuote & "|" QuoteList = QuoteList & Quote(RndQuote) & "|" Next QuoteList = Left(QuoteList,Len(QuoteList)-1) QuoteArr = Split(QuoteList,"|") For x = 0 to UBound(QuoteArr) Response.Write QuoteArr(x) Next %>
You can't do this I'm afraid See http://www.asp101.com/articles/michael/dynamicincludes/default.asp for an explanation/
Put your tables in a Database and call out one using a random function This works in SQL server select top 1 * from MyTable where <column> = <parameter> order by NEWID()