Associate
Hi guys, i'm trying to make a random image appear in the large plack box on the index.php page..
www.dtonkin.co.uk
the php script i'm using seems to work as when you refresh the page and view source it points to the two different images i have on the server randomly but isnt showing the image itself.
This is the script:
<?php
$file_array = array
('http://www.dtonkin.co.uk/images/artwork/colour_01.jpg',
'http://www.dtonkin.co.uk/images/artwork/colour_02.jpg');
$total = count($file_array);
$random = (mt_rand()%$total);
$file = "$file_array[$random]";
print("<img src=$file></a>");
?>
I'm wanting to put it within a div on the site, but i guess its got something to do with the css?
Any ideas what i have to do?
Cheers
www.dtonkin.co.uk
the php script i'm using seems to work as when you refresh the page and view source it points to the two different images i have on the server randomly but isnt showing the image itself.
This is the script:
<?php
$file_array = array
('http://www.dtonkin.co.uk/images/artwork/colour_01.jpg',
'http://www.dtonkin.co.uk/images/artwork/colour_02.jpg');
$total = count($file_array);
$random = (mt_rand()%$total);
$file = "$file_array[$random]";
print("<img src=$file></a>");
?>
I'm wanting to put it within a div on the site, but i guess its got something to do with the css?
Any ideas what i have to do?
Cheers