I have worked on this for almost a month to no avail, so I must finally ask for help.
I wish to create a countdown timer that uses the time from the server (not the local machine) eg, current_time = <?php server_time_as_the_seed; ?> and have the countdown display the Days, Hours, Minutes, Seconds in a continuing fashion. eg, 58, 57, 56… you get the idea.
I have tried modifying numerous javascript countdown clocks with almost identical disappointing results. I can pass the server’s time in php (time()) and the scripts will display the correct time until the event, but WILL NOT continue to countdown.
I have tried things like adding Javascript’s Date() to PHP time(), then subtracting it (or portions of it) back out again to sort of jumpstart the countdown process. While the countdown will begin counting, the dates are way off. Then when I do get close I get NaN results (even if I manually set types to Intergers). eg. (JS_Date + php_time() – JS_Date) a very rough example.
I have tried setting the time both inside and outside functions, all ending in the same displaying time and no counting down, 12, 11, 10….
Summary:
Apache Server (10:00:00am) >php4.2 (date or time function seed 10:00:00am)> Javascript 1:00:00 until 11:00:00 am on the server (59:59 59:58 59:57 …) remaining.
Again, I must be missing something incredibly simple here, so any suggestions or examples will be greatfully received.
As for an example of countdown code, I have downloaded at least 25 different examples posted by others as a base to work from, none of which have I been able to make work for me. If someone can simply post a bit of something that will work, I am confident that I will be able to incorporate it into my desired script. If however you do wish to see the script that currently seems to be the one I am leaning toward using, I will post it (with credits) if requested.
Again, Thank you.