Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    5

    Simple sequential file script needed - HELP!

    Hi there,

    Can anyone help me with the following:
    I need some javavscript or ASP code that simply allows me to redirect someone who visits my homepage, to a number of sequential ASP files.
    ie - when someone arrives at my default.asp page they are immediately redirected to default1.asp.And when the next person comes to my default.asp homepage - they are immediately sent to default2.asp. And so on and so on.

    Here is some javascript that allows me to load files randomly - but not sequentially.

    <!-- Begin
    var howMany = 1; // max number of items listed below
    var page = new Array(howMany+1);

    page[0]="default3.asp";
    page[1]="default2.asp";

    function rndnumber(){
    var randscript = -1;
    while (randscript < 0 || randscript > howMany || isNaN(randscript)){
    randscript = parseInt(Math.random()*(howMany+1));
    }
    return randscript;
    }
    quo = rndnumber();
    quox = page[quo];
    window.location=(quox);
    // End -->

    Any ideas anyone?

    cheers
    Mark

    mark_overmars2002@yahoo.com.au

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Try here

    http://www.dbforums.com/f192

    Or

    http://www.dbforums.com/f193

    This is a place of disconnected ramblings...

    Come join us....

    http://www.dbforums.com/showthread.p...33#post3672433
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •