Want to take part in these discussions? Sign in if you have an account, or apply for one below
Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
<?php
$MIN_IMGS = 0;
$MAX_IMGS = 9;
// notifies the client this IS a css, despite php extension
header('Content-Type: text/css');
$i = mt_rand($MIN_IMGS, $MAX_IMGS); // randomizes 0 <= i <= 9
$img = 'head' . $i . '.png'; // we'll suppose you have head0.png, head1.png, ..., head9.png
the IMGS will be
?>
#header-id-I-dont-remember {
background : url(../imgs/<?php echo $img; ?>);
}
@import url(head.css.php);<div class="header"></div><div class="header rand-img-{"0"|mt_rand:9}"></div>.rand-img-0 {background: url('../imgs/img-you-want-first.png'); }
.rand-img-1 {background: url('../imgs/img-you-want-second.png'); }
/* ... etc etc ... */
.rand-img-9 {background: url('../imgs/img-you-want-last.png'); }1 to 6 of 6