The work PHP has to do to pick a random image is pretty insignificant. If the server is really busy, a bigger problem will be having to serve numerous different pictures (cuz the browser might not have the picture selected already stored in its cache).
A php script like:
Will put little to no strain on the server.PHP Code:
$pictures = array("picture1.jpg", "another.gif", "onemore.png", "hello.bmp");
$imagecount = count($pictures);
$rand = rand(0, $imagecount - 1);
echo '<image src =\"' . $pictures[$rand] . '\">';
PHP would be your best bet, as it would require pretty much 0 server strain, while JS is client specific and could cause problems for those without JS enabled.
<(^.^<) \(^.^\) (^.^) (/^.^)/ (>^.^)>
Core 2 Duo E8400 clocked @ 3.375GHz, 2x2GB 800MHz DDR2 RAM
5x SATA drives totalling 2.5TB, 7900GS KO, 6600GT
Great, I think PHP sounds like the way to go then. Thanks for all the advice everyone, and thanks for the code as well, Dylannn!
Last edited by Dylan B; May 14, 2005 at 05:31.
Oh, cool, took me a second to figure out what you were talking about. It's nice to finally have a way to reward all of the helpful people here!Originally Posted by Dylannn
Yeah, rep is an awesome feature.
I was simply informing him on the repgiving capabilities of vBulletin v3.0.3. It was his interpretation of said word to give said rep.
Last edited by Dylannn; Apr 28, 2005 at 22:29.