PHP image rotation script

Last week I went hunting for a little script that would rotate an image and a caption with every screen refresh. Should be a simple task, no?

I found many JavaScript ones, all different. I’m not a JavaScript expert and I like implementing code that I can get my head around – not many of the ones I found fit that bill. Plus, knowing that some visitors may have JavaScript turned off I thought better of it.

I looked for PHP scripts – I didn’t find as many, but I think I really lucked out when I discovered this tiny little PHP rotation script from Sue Crocker.

I love this. You just put it where you want to show the images and bang, it runs. No problems, no confusion. You put the images and accompanying captions into a text file separated by NEXT statements like this one. Within this text file, you can assign a CSS class to the captions so that they’ll show up in an absolutely positioned space and not directly under the image, as you can see in this page in progress. It’s the Featured Flower at the bottom that’s running the script – refresh the page to see it in action.

And it works beautifully. This is one of the most elegant and simple solutions I’ve found in a while.


  1. ah, i was so excited to find your post as i’m looking for exactly what you describe. but sadly your links seems to be broken. if you would be willing to email the script to me i’d be eternally grateful.

  2. Hi there,

    Great post, I have basically the same comment as Sara, I am really interested in using the same script but the links appear to be broken. Could you please email me the links.

    Thank! 🙂

  3. You’re describing the script I’ve been looking for, but unfortunately the link is broken.

    Feel free to e-mail the script to me.

    I’d really appreciate it!

Leave a Reply

Your email address will not be published. Required fields are marked *