Re: Form Mail replacement

by "John Romano" <jromano(at)pb.net>

 Date:  Wed, 29 Dec 1999 18:34:31 -0500
 To:  <ml(at)digitaldaze.com>
 Cc:  "Susan Bishop" <susan(at)angara.com>, "HWG Servers-List" <hwg-servers(at)hwg.org>
 References:  digitaldaze
  todo: View Thread, Original
Hmm.  Thanks for the heads up.  I'll send a copy of this over to Joey.

Quick and dirty two line fix....  Which should work till 2200. Unless 4
digit years is what we want... but I don't think we want them since the
world is trying so hard to be 2 digit year compatible.  If 100 year old mail
comes through... get a new pony.

      unless ($NO_TIME) {
                @tl = localtime(time());
                ++$tl[4]; # Add one to the months
                # Add a leading '0' onto the times
                $tl[0] = "0$tl[0]" if ($tl[0] < 10);
                $tl[1] = "0$tl[1]" if ($tl[1] < 10);
                $tl[2] = "0$tl[2]" if ($tl[2] < 10);

                #Y2K Fix
                $tl[5] = $tl[5]-100 if ($tl[5] > 99);
                $tl[5] = "0$tl[5]" if ($tl[5] < 10);

                # Makeup time string
                $timestr = "$tl[4]/$tl[3]/$tl[5] $tl[2]:$tl[1]:$tl[0]";
                send (SOCKFL,"Date: $timestr\n",0);
        }


John Romano


----- Original Message -----
From: Mailing List Account <ml(at)digitaldaze.com>
To: John Romano <jromano(at)pb.net>
Cc: Susan Bishop <susan(at)angara.com>; HWG Servers-List <hwg-servers(at)hwg.org>
Sent: Wednesday, December 29, 1999 5:31 PM
Subject: Re: Form Mail replacement


> Hello,
>
> > He worked on it for a while, then decided a full re-write was necessary.
> > This is what he came up with;
> >
> > http://www.glass-castle.com/joeyform
> >
> > It works based on the usual hidden input types, has ip/domain security
and
> > requires cgi-lib.pl.  I don't believe it has a problem with date
creation.
> > I checked the code and it appears that it'll make a "xx/xx/00" date. I
think
> > it's system dependant, as most apps are.
>
> On January 1, 2000, the joeyform.pl script will return a date of 01/01/100
> On January 1, 2001, the joeyform.pl script will return a date of 01/01/200
>
> You should let your friend know about this.  The year value returned by
> localtime is the current year - 1900 (or number of years after 1900).  The
> year 2000 is then 2000 - 1900 = 100.
>
> This is the same problem the formmail.pl script has and is quite common if
> you don't read the docs on localtime very carefully.

HWG: hwg-servers mailing list archives, maintained by Webmasters @ IWA