Mostly about my amusement

Day: July 6, 2007 (page 1 of 1)

XHTML and image rotate for the header

I’ve had some free time so I’ve added so I went through all my posts (153!) and made sure they validate as XHTML strict. I’ve also played with this theme and added the image rotator for the header.

Using Matt’s rotate.php script, I created a directory called and dumped some images in there.  The images were lifted from Stefan’s Flickr page.  His pictures are great and I was using one of his images as a banner already.

In my CSS file I replaced the

#header {
background: url(img/bus.jpg) no-repeat bottom;

with

#header {
background: url(img/rotate.php) no-repeat bottom;

Per the CSS for my header the files should be 700×175; which I forgot and created 700×200 images. No big deal the CSS fixes the images to fit.

The fun part was getting the caching to work so I could see the files and how they look. Internet Explorer and Firefox cache the page to make the whole experience is faster. But that also means that when I reloaded the page the banner would not necessarily change.

Using Google I found that adding the following right below the <head> statement in my header.php would get Internet Explorer and Firefox to reload the whole page with a new banner (most of the time).

<meta http-equiv=”Expires” content=”Tue, 01 Jan 1980 1:00:00 GMT” />
<meta http-equiv=”Pragma” content=”no-cache” />

I turned it off after my curiosity was satisfied. Caching is your friend and should be respected.