Very nice! One interesting thing - I don't know if PHP does this, but Coldfusion generates random numbers based on a system timer, so any simultaneous requests will get the same random number. From the screen output, you can see how many requests are hitting the page at the same time:
1: The random number is 0.361913578305
2: The random number is 0.361913578305
3: The random number is 0.363346901562
6: The random number is 0.363346901562
5: The random number is 0.363346901562
4: The random number is 0.363346901562
7: The random number is 0.640690712302
8: The random number is 0.640690712302
9: The random number is 0.636390802138
10: The random number is 0.636390802138
Of course, you could do the same thing just by returning the value of that system timer, which in CF is gotten by the getTickCount() function.
If you use RandRange you can specify which algorithm to use. Or use rand() with randomize() to seed the random number generator.
RandRange(number1, number2[, algorithm])
ColdFusion MX 7: Added the algorithm parameter.
Integer numbers. If the numbers are not in the range -2,147,483,648 - 2,147,483,647, ColdFusion generates an error.
(Optional) The algorithm to use to generated the random number. ColdFusion installs a cryptography library with the following algorithms:
CFMX_COMPAT: the algorithm used in ColdFusion (default).
SHA1PRNG: generates a number using the Sun Java SHA1PRNG algorithm. This algorithm provides greater randomness than the default algorithm
IBMSecureRandom: for IBM WebSphere (IBM JVM does not support the SHA1PRNG algorithm.)
Presumably the querystring-parameter you are passing to the other page, which is not currently used, can be used as the seed.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
Last edited by AndrewGSW; 12-15-2012 at 06:43 PM..