Clan x86

Technical (Development, Security, etc.) => General Programming => Tutorials, References, and Examples => Topic started by: Joe on September 11, 2005, 03:23:19 AM

Title: [PHP] Simple Countdown
Post by: Joe on September 11, 2005, 03:23:19 AM
Teaches date() and number manipulation.

<?
  $EVENTMONTH = "9";
  $EVENTDAY   = "25";
 
  $NOWMONTH   = date("m");
  $NOWDAY     = date("d");
 
  $DIFFMONTH  = $EVENTMONTH - $NOWMONTH;
  $DIFFDAY    = $EVENTDAY   - $NOWDAY;
?>

<link rel="stylesheet" type="text/css" href="datatypes/stylesheet.css" />

<html>
  <head>
    <title>Joe's Birthday Countdown</title>
  </head>
  <body>
    <center>
      <h1>Joe's Birthday Countdown</h1>
      <? echo("$DIFFMONTH"); ?> months.<br />
      <? echo("$DIFFDAY"); ?> days.<br />
    </center>
  </body>
</html>


http://www.javaop.com/~joe/birthdaycountdown.php
Title: Re: [PHP] Simple Countdown
Post by: Ryan Marcus on September 11, 2005, 09:34:08 AM
Or you could do it in JavaScript and have live updating.  :o

Title: Re: [PHP] Simple Countdown
Post by: deadly7 on September 11, 2005, 12:36:59 PM
Don't let War let you hear saying that. ;) He finds JS to be the devil.
Title: Re: [PHP] Simple Countdown
Post by: Blaze on September 11, 2005, 01:06:50 PM
Why not a java applet then?  Not quite JS. :P
Title: Re: [PHP] Simple Countdown
Post by: Sidoh on September 11, 2005, 02:54:16 PM
Quote from: deadly7 on September 11, 2005, 12:36:59 PM
Don't let War let you hear saying that. ;) He finds JS to be the devil.
Javascript is the devil.

And joe... I'm not even going to respond to that, K?  :)
Title: Re: [PHP] Simple Countdown
Post by: trust on September 11, 2005, 08:08:08 PM
Quote from: Sidoh on September 11, 2005, 02:54:16 PM
Quote from: deadly7 on September 11, 2005, 12:36:59 PM
Don't let War let you hear saying that. ;) He finds JS to be the devil.
Javascript is the devil.

And joe... I'm not even going to respond to that, K?  :)

You just did, K? :)
Title: Re: [PHP] Simple Countdown
Post by: Joe on September 12, 2005, 01:38:54 AM
k.