View Full Version : Random number generator?
Sypher
Sun 10th Dec '00, 9:32pm
I'd like to add some banner rotating code to the header or footer of my forum. I went with LinkBuddies and they give the option of either standard HTML or Javascript code. It asks for a page number and in the code there is a part with your ID number and then "+1" or whatever number you put in as the page number. Is there something I can put in place of that number to generate a random number?
Mike Sullivan
Mon 11th Dec '00, 10:04am
You can just use javascript or php's time() function. (or php's random number function :))
Menno
Mon 11th Dec '00, 10:47am
srand((double)microtime()*1000000);
$logonr=rand(1,3);
works for me. The result is a number between (& including) 1 and 3
JimF
Mon 11th Dec '00, 12:00pm
Ed - I was thinking about making a hack that would include a php random number generator - so in your templates you could just put $bannerbits or something like that. And the user could specify how many characters they would need. Do you think many people would find it useful?
-jim
Sypher
Mon 11th Dec '00, 2:57pm
Does javascript have a random number or time function I can just plug in place of the "+1" digit?
vBulletin® v3.8.0 Release Candidate 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.