View Single Post
Old 02-02-2008, 10:17 AM  
dozey
Confirmed User
 
dozey's Avatar
 
Join Date: Nov 2004
Location: Moonland
Posts: 552
If you don't want visitors to manually refresh and see a suspiciously different picture of you almost instantly, I suggest you use something like this (assuming you're running PHP).

PHP Code:
<?php
srand
(floor(time()/30));
// seed uniquely only once every 30 seconds

// load a list of all the images
$imagesArray glob('/pathtoimages/*.jpg');

if(
count($imagesArray) > 0){
    
header('Content-type: image/jpeg');
    
// output a random image
    
readfile($imagesArray[array_rand($imagesArray)]);
}
?>
Incidently, I haven't tested that at all.

Last edited by dozey; 02-02-2008 at 10:18 AM..
dozey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote