PHPBuilder - Random Html Pages



RSS Twitter
Snippets Html

Random Html Pages

by: Karita Herdes
|
May 20, 2003

Version: 1.0

Type: Full Script

Category: HTML

License: GNU General Public License

Description: Allows you to have random splash pages for your website...an example can be seen at http://specialk.cleotis.com



<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var howMany = 7;  // max number of items listed below not counting 0
var page = new Array(howMany+1);

page[0]="folder/filename.html";
page[1]="folder/filename.html";
page[2]="folder/filename.html";
page[3]="folder/filename.html"; 
page[4]="folder/filename.html";
page[5]="folder/filename.html";
page[6]="folder/filename.html";
page[7]="folder/filename.html";
page[8]="folder/filename.html";

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 -->

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Karita Herdes

Comment:



Comment:

(Maximum characters: 1200). You have characters left.