Web Analytics Made Easy -
StatCounter Please!! HELP ME!! - CodingForum

Announcement

Collapse
No announcement yet.

Please!! HELP ME!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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!!!!!

      Comment


      • #4
        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.
        De gustibus non est disputandum.

        Comment


        • #5
          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; Jul 1, 2002, 09:50 AM.
          Yippi!!
          It's SUMMER!!!!!

          Comment

          Working...
          X