I am trying to figure out the best way to go about generating a random number but having that number stored on a separate html page.
I am setting up a forum that allows quest posting but I wish to offer a way for the OP to request thread deletion or an edit, The only way I can see to achieve this would be to generate a random code to be displayed after thread creation (which I have a script for) but I then need to save that code in the thread with a conditional so that only admin and mods can see but I cant seem to figure out how to store the generated number into a separate html page.
If anyone has any ideas it would be much appreciated, below is the script I am currently looking at.
CODE
<script LANGUAGE="JavaScript">
num= new Array(16);
for (i=0; i<16; i++) {
num[i]=Math.floor(16*Math.random()+1);
if (num[1]==num[0]) {
while (num[1]==num[0]) {
num[1]=Math.floor(16*Math.random()+1);
}
}
if (num[2]==num[1] || num[2]==num[0]) {
while (num[2]==num[1] || num[2]==num[0]) {
num[2]=Math.floor(16*Math.random()+1);
}
}
if (num[3]==num[2] || num[3]==num[1] || num[3]==num[0]) {
while (num[3]==num[2] || num[3]==num[1] || num[3]==num[0]) {
num[3]=Math.floor(16*Math.random()+1);
}
}
document.write(num[i],"");
}
</SCRIPT>
num= new Array(16);
for (i=0; i<16; i++) {
num[i]=Math.floor(16*Math.random()+1);
if (num[1]==num[0]) {
while (num[1]==num[0]) {
num[1]=Math.floor(16*Math.random()+1);
}
}
if (num[2]==num[1] || num[2]==num[0]) {
while (num[2]==num[1] || num[2]==num[0]) {
num[2]=Math.floor(16*Math.random()+1);
}
}
if (num[3]==num[2] || num[3]==num[1] || num[3]==num[0]) {
while (num[3]==num[2] || num[3]==num[1] || num[3]==num[0]) {
num[3]=Math.floor(16*Math.random()+1);
}
}
document.write(num[i],"");
}
</SCRIPT>