|
-
Jun 30th, 2007, 12:10 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Countdown help
I've got a script that counts down to a certain date, the problem I'm having is when the date has past the countdown message still shows, I want it to show another message when the date has past, heres what I've done so far:-
PHP Code:
<?php
$day = 30;
$month = 06;
$year = 2007;
$target = mktime(0,0,0,$month,$day,$year);
$days = ($usedtime - ($usedtime % 86400)) / 86400;
$usedtime = $usedtime - ($days * 86400);
$hours = ($usedtime - ($usedtime % 3600)) / 3600;
$usedtime = $usedtime - ($hours * 3600);
$minutes = ($usedtime - ($usedtime % 60)) / 60;
$usedtime = $usedtime - ($minutes * 60);
$seconds = ($usedtime - ($usedtime % 1)) / 1;
if ($day < "0"){
$txt = "This offer has now finished.";
} else {
$txt = "This offer will end in $days days, $hours hours, $minutes minutes, and $seconds seconds.";
}
printf("<font face=\"$font_type\" size=\"$font_size\" >$bolda $txt $boldb</font>");
?>
-
Jun 30th, 2007, 12:59 AM
#2
Addicted Member
Re: Countdown help
In between
and
value of $day has not changed. So , it will always be 30, thereby satisfying only the "else" condition.
-
Jun 30th, 2007, 01:54 AM
#3
Thread Starter
Addicted Member
Re: Countdown help
Thanks fixed it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|