You should alter
top_header.png in stylesheet.css with the dynamically generated image.
- #top_logo{
- border-width: 0px 0px 0px 0px;
- margin: 0px 0px 0px 0px;
- padding: 0px 0px 0px 0px;
- background: url('./images/top_header.png') repeat;
- height: 150px;
- }
You need a dynamic image and there are several ways for doing that.
Usually you should code a php files which generate the images and then use directly the PHP files (with correct headers) or use an htaccess rule to redirect a PNG call to the PHP files.
So in a nutshell, here is a demo for a dynamic PHP image (supposing you have the JPG files listed in the array):
- <?php
-
- $img_array = array('bkg_01.jpg', 'bkg_02.jpg', 'bkg_03.jpg', 'bkg_04.jpg', 'bkg_05.jpg', 'bkg_06.jpg', 'bkg_07.jpg', 'bkg_08.jpg', 'bkg_09.jpg', 'bkg_10.jpg', 'bkg_11.jpg', 'bkg_12.jpg', 'bkg_13.jpg', 'bkg_14.jpg', 'bkg_15.jpg');
-
- $img_rnd = rand(0, sizeof($img_array) - 1);
-
- header('Content-type: image/jpg');
- header('Content-Disposition: filename=' . $img_array[$img_rnd]);
- readfile($img_array[$img_rnd]);
-
- ?>
Suppose you call this PHP file
my_bg.php then you can use this file directly in the CSS (or use htaccess to redirect that file using a JPG call instead).