Random image
- Started
- Last post
- 7 Responses
- karlo
Does anyone have any code on how to:
Everytime the page loads you get a random image... So I have 5 images that I want to rotate:
1.jpg
2.jpg
3.jpg
4.jpg
5.jpgYou get the idea
Ta
Karlo
- karlo0
Bump
- bolus0
i use php and a mysql database... this is the code:
{$file_array = array
('http://www.janpostma.com/37.jp...
'http://www.janpostma.com/41.jpg...
'http://www.janpostma.com/42.jpg...
'http://www.janpostma.com/85.jpg...
'http://www.janpostma.com/45.jpg...$total = count($file_array);
$random = (mt_rand()%$total);
$file = "$file_array[$random]";
echo("");}
- version30
i do it without arrays and it does jpg png and gif
it just uses images in the specified directory
karlo check your mail
- version30
and to make mine work you simply add rndm.php as the image
< img src= "rndm.php" >
- karlo0
Cheers boys!
Have a top weekend!
- barbtastic0
is there a code to randomly change the background color each time the page loads from a set of pre-determined colors?