Log in

View Full Version : A series of random images opposed to one


PennylessZ28
10-25-2005, 09:30 PM
I have been using this for a random image

In my phpinclude


$total = "11";

$file_type = ".gif";

$image_folder = "images/random";

$start = "1";

$random = mt_rand($start, $total);

$image_name = $random . $file_type;

Then in the template I use the following code <img src=\"$image_folder/$image_name\" alt=\"$image_name\" />

So I have been reading and the one thing I haven't seen is, a set of rotating images.

And I might be wording this wrong.

Lets say I create one banner that uses 3 images, we will call them A B C

What if I wanted to create A1 B1 C1 and then have them randomly rotate to A2 B2 C2 or A5 B5 C5

So far all I have manged to do is A1 B7 C3

I can't get them to to rotate in squence.

jugo
10-25-2005, 09:40 PM
in that case you have to use arrays so that goes in order.