Results 1 to 3 of 3

Thread: [RESOLVED] Countdown help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    190

    Resolved [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>"); 
    ?>

  2. #2
    Addicted Member
    Join Date
    Feb 2006
    Location
    Hyderabad, India
    Posts
    233

    Re: Countdown help

    In between
    Code:
    $day=30
    and
    Code:
    if ($day < "0")
    value of $day has not changed. So , it will always be 30, thereby satisfying only the "else" condition.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    190

    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
  •  



Click Here to Expand Forum to Full Width