PDA

View Full Version : Random image in backgroud



jusko
August 2nd, 2004, 12:58 PM
Hello! Im developing a website and I want that each time someone enters the site or refreshes the home page, a new image shows randomly in the background.
Any help???

thanks, jusko

signifer123
August 2nd, 2004, 01:03 PM
this flash or html?

ruski_flasher
August 2nd, 2004, 01:05 PM
//offtopic-why is it always 1337? [as in 1337 hAx0r]

jusko
August 2nd, 2004, 01:07 PM
its in html... but its better if its done in flash???

signifer123
August 2nd, 2004, 01:08 PM
no its jjust i'm not good with pictuees and html so i can't tell you how ot do that, sorry

Jeff Wheeler
August 2nd, 2004, 01:09 PM
you could link to a php page for the background, send headers in the php that tells it that it's an image, and also return a random image ;)

nykoelle
August 4th, 2004, 07:07 PM
yea, you'll have to use php. Somethign with rand. Have the background images named numbers, like 1.gif 2.gif 3.gif then have:



<?php
$pic = rand(1,3);
?>

...

<body style="background: url('<?=$pic; ?>.gif');">

Jeff Wheeler
August 4th, 2004, 11:51 PM
well that works too... and is shorter :D