Permanent VARIABLES and "Smart Countdown" ?
Posted on 1997-11-03
I have created a small program which shows the minutes left to the top of the hour (ie. if it's 9:34pm right now, the count down show: 00:26 mins left). I used the <IMG> command to call my CGI script which sends back binary data of a GIF picture corresponding to the correct digits of the minutes left. So it looks like I have a "graphical" countdown of the minutes left.
I want the user of my web site to have the ability to refresh the screen, leave my web site and BACK up to it at a later time, and to ALWAYS see my countdown at the EXACT minutes left before the hour. I achieved this with always calling my CGI script to get the latest minutes left. Unfortunately, I want ONE more thing. I want the countdown to countdown to 00:00 and never go past this! As soon as it hits 00:00 it pops up a new graphic to tell user to RELOAD the web page since it is old.
Now if the user is allowed to leave my web site and is allowed to back up to see the NEW minutes left before the hour, he could leave my web site for DAYS and then back up to it seeing the new minutes left before the hour, but 00:00 of the hour he really came in had long passed. The graphic that should pop up would never pop up until 00:00 is reached for this hour.