I'm wanting to get a random image on my main page, but always START with image 1. I have really no idea how to handle this.
I saw the array_rand function elsewhere while searching for help and started with this:
srand ((float) microtime() * 10000000);
$directory="/images/front/";
$input = array ("erp.jpg", "solutions.jpg", "something.jpg", "whatever.jpg");
$keys = array_rand ($input, sizeof($input));
while (list($k, $v) = each($keys))
{
echo $new_input = $input[$v];
}
It gives me everything, when what I really want is just 1 output.
Furthermore, I also want it to start with 0 when the user first sees the page. Is this something best handled with sessions? CAVEAT: session_start() will NOT work on my ISP, but session_register() will.
Does anyone have a script for this sort of action, either using a database or without? The directory to pull from and selection of images will remain static.
Thanks,
Eve