Countdown image using gd as a gif

Hi guys,

Would like to use php to create a dynamic countdown timer as a gif animation for use in an email.

For example - “SALE NOW ON - 5 days remaining” and have:

Days: 4, Hours: 23, Minutes: 59, Seconds: 59

That kind of thing, where the seconds and minutes will countdown. I know there are hundreds of Javascript counters (use on on my site already), but no way of putting these in an HTML email.

Has anything like this been done before with php? I’ve seen static php-generated images, but no animated gif ones.


But using an animated GIF won’t work…

What if I get your mail that contains an embedded gif counting down from 5 days, and then open it again after two days. It will still count down from 5 days.

Unless you generate a new GIF every time it’s requested, but that’ll be pretty harsh on the server (and bandwidth) and most people don’t actually let their mail client download images.

Or am I missing something?

or HTML for that matter. Many mail clients and even some servers (like mine) even assume that if the e-mail is HTML, it’s automatically spam.

I know there’s no legitimate reason for anyone I talk to via e-mail to be sending it in anything other than plaintext :wink: