Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Trondheim. Norway
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Please!! HELP ME!!

    Yo!
    I need a countdown-script in PHP!!
    It have to be easy to configurate!!!!
    I hope someone can help me..

    (I know that everything I writes not is correct english...
    Thats because I'm a 12 year old boy from Norway...
    And I'm not THAT good in English...)

    -RiiWeN
    Yippi!!
    It's SUMMER!!!!!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what do you mean by countdown? does that mean the page will only be accesible a certain number of times or does that mean evry time you go to that page you need a small box which has a countdown timer? if it is the latter then a mod should throw thi over to javascript programming because thats the easiest way aof making one
    photoshop too expensive? use the GIMP! www.gimp.org

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Trondheim. Norway
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    That I meant was;

    That I meant was;
    I want to count down to for example 15th of July...
    I got a script like this;

    <?

    $dato = "20020715";
    $mld = "dag igjen";
    $mld2 = "dager igjen";
    function daysbetween($start, $target) {
    $start = ereg_replace("-", "", ereg_replace("/", "", $start));
    $target = ereg_replace("-", "", ereg_replace("/", "", $target));
    $from = mktime(0,0,0, substr($start, 4, 2), substr($start, 6, 2), substr($start, 0, 4));
    $to = mktime(0,0,0, substr($target, 4, 2), substr($target, 6, 2), substr($target, 0, 4));
    $daysbetween = ($to - $from) / 86400;
    return $daysbetween;
    }

    $start = date("Ymd");
    $target = "$dato";
    round(daysbetween($start,$target), 0);
    $igjen = ($target-$start);

    echo ($igjen == 1) ? "$igjen $mld" : "$igjen $mld2";

    ?>

    But it doesn't work...
    What's wrong??
    I'm verry sorry about the script is in Norwegian...
    Transelation:
    Dag(er) igjen - Day(s) left
    Dato - Date
    $igjen $mld - $again $mld

    Somebody that understand???
    I'll again tell you that I'm NOT VERY GOOD IN ENGLISH!!

    -RiiWeN
    Yippi!!
    It's SUMMER!!!!!

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: That I meant was;

    Change these lines

    PHP Code:
    $target "$dato";
    round(daysbetween($start,$target), 0);
    $igjen = ($target-$start); 
    to

    PHP Code:
    $target "$dato";
    $igjen round(daysbetween($start,$target), 0); 
    and that should do the trick.

  • #5
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Trondheim. Norway
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Alright

    Alright..!!!
    Thank you a lot!!!!
    Are you sure if it works??
    Hope so.
    I'll try it.
    IT WORKED!!!
    THANK YOU!!

    -RiiWeN
    Last edited by RiiWeN; 07-01-2002 at 03:50 PM.
    Yippi!!
    It's SUMMER!!!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •