Random Server Side Includes

Discussion in 'ASP General' started by Microsoft News, Sep 17, 2003.

  1. 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
     
    Microsoft News, Sep 17, 2003
    #1
    1. Advertising

  2. Microsoft News

    dlbjr Guest

    FEEL THE WIND!

    -dlbjr

    Discerning resolutions for the alms
     
    dlbjr, Sep 17, 2003
    #2
    1. Advertising

  3. Microsoft News

    n/a Guest

    come on, what in the world is this??????????????

    On Wed, 17 Sep 2003 17:28:36 -0500, "dlbjr" <> wrote:

    >FEEL THE WIND!
    >
    >-dlbjr
    >
    >Discerning resolutions for the alms
    >
    >
     
    n/a, Sep 18, 2003
    #3
  4. "Microsoft News" <> wrote in message
    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
    >

    http://aspfaq.com/2042
     
    Chris Hohmann, Sep 18, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William F. Zachmann
    Replies:
    6
    Views:
    2,637
    William F. Zachmann
    Oct 25, 2005
  2. Martin Olson
    Replies:
    1
    Views:
    571
    Martin Olson
    Dec 16, 2005
  3. David Dorward

    Re: Server-Side Includes

    David Dorward, Jul 20, 2003, in forum: HTML
    Replies:
    0
    Views:
    359
    David Dorward
    Jul 20, 2003
  4. globalrev
    Replies:
    4
    Views:
    773
    Gabriel Genellina
    Apr 20, 2008
  5. VK
    Replies:
    15
    Views:
    1,177
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page