Logging with date and time...

Example of what is logged:
HostName: carbon.chalmers.com.au from 203.1.96.26 using Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.0): Date & Time is Thu Nov  8 03:39:25
2001

Code Example.
#!/usr/local/bin/perl
use CGI qw(:all);
$webmaster = "robert\@chalmers.com.au";

my $tz = param('tz') || "Timezone Not Specified";
$timehere = scalar(localtime(time));
#................................................
#======================================================
@MoY =
('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
@DoW =
('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year += 1900;
$Month = $MoY[$mon];
$Day = $DoW[$wday];
$TimeString = "$Day-$hour:$min";
# ==========================================================================

    print "Content-type: text/html\n\n";
    print "<HTML>\n";
    print "<HEAD>\n";
    print "<TITLE>Watching Callers</TITLE>\n";
    print "</HEAD>\n";
    print "<BODY>\n";
    print "<H1>Watching Callers</H1>\n";
    print "<HR>\n";
    print "<P>\n";
    print "Your HostName: $ENV{'REMOTE_HOST'} from $ENV{'REMOTE_ADDR'}<br>
and using $ENV{'HTTP_USER_AGENT'}<BR>\n";
    print "Input proccessing.  Please mail your ";
    print "questions to $webmaster\n";
    print "</BODY>\n";
    print "</HTML>\n";

open (DB,">>orders.log") or die "File Error";
print DB "HostName: $ENV{'REMOTE_HOST'} from $ENV{'REMOTE_ADDR'} using
$ENV{'HTTP_USER_AGENT'}: Date & Time is $timehere\n";
close (DB);

# ==========================================================================
print "<P>";
print ",  $TimeString<br>\n";
print "Date & Time is $timehere<br>\n";

#
===========================================================================
~
~


cheers
Robert




----- Original Message -----
From: "Jeff Miller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 07, 2001 8:45 AM
Subject: Re: Logging IP Address of Orders?


> Looks like your finding some good stuff!  Try adding this to the bottom of
> your reg_system.cgi file right after the last EOF
>
>
> open (DB,">>/home/wavesai/public_html/domain_registrations/orders.log") or
> die "File error";
> print DB " IP=$ENV{'REMOTE_ADDR'} domain={domain}
> affiliate=$in{affiliate_id}<BR>\n";
> close (DB);
>
> I can get it to save the IP address but I need it to save the domain of
the
> order and maybe the time if we can find the variable for it.  You could
then
> check this file everytime you go to set up an order.
>
> BTW...I wouldn't recommend blocking IP addresses.  I believe the more of a
> challange you make it for them...it will make them made and the more
likely
> it will be harder to figure out the easily detectable fraudulant orders.
>
> Jeff
>
>
>
> >From: "Robert" <[EMAIL PROTECTED]>
> >To: "Jeff Miller" <[EMAIL PROTECTED]>
> >Subject: Re: Logging IP Address of Orders?
> >Date: Wed, 7 Nov 2001 08:37:48 +1000
> >
> >This does a web page thing, but being perl, it's easy to change to open a
> >file and log the addresses - and darn near any other info. Just call it
as
> >a
> >subroutine from reg-system.cgi
> >
> >I'll work on it later today....
> >
> >bob
> >#!/usr/local/bin/perl
> >print "Content-type: text/html\n\n";
> >print "<p>The local time on this server is: <b>",
> >scalar localtime,"</b> (mountain time).\n";
> >my $ip_num = pack("C4", split(/\./, $ENV{REMOTE_ADDR}));
> >my $remhost = scalar gethostbyaddr($ip_num, 2);
> >print "<p>You are connected from <b>$ENV{REMOTE_ADDR}</b>";
> >if ($remhost && $remhost ne $ENV{REMOTE_ADDR}) {
> >     print " which resolves to hostname <b>$remhost</b>.\n";
> >} else {
> >     print " which does not resolve to a hostname.\n";
> >}
> >print " If you don't think this is you, then you may be ",
> >" going through a firewall, proxy or network cache.\n";
> >
> >
> >
> > > I just finished setting everything up on my account and was wondering
if
> > > there is a way to log the IP address of every order submitted.
> > >
> > > I've been doing web hosting for over three years and about 60% of the
> >orders
> > > I receive are fraud.  The easiest way to tell is to take the IP
address
> >off
> > > the order and do a Traceroute using VisualRoute.  It will show you
where
> >the
> > > order was placed from.  Most of the time the fraudulant orders I
receive
> > > have all the correct info of a US resident, name, address, telephone
> >number.
> > >   When I see the order was placed in Russia, Indonesia, Malaysia, etc.
I
> > > delete it.
> > >
> > > Back when I first started web hosting I didn't think about getting
> >orders
> > > with stolen credit card numbers.  This ended up costing me over a
> >thousand
> > > dollars due having to pay my web host and the $25 chargeback fees.
> > >
> > >
> > > Is there some way to log the IP address of orders?  I don't even want
to
> > > think about accepting any domain orders until this is possible.
> > >
> > >
> > > Jeff
> > >
> > >
> > > _________________________________________________________________
> > > Get your FREE download of MSN Explorer at
> >http://explorer.msn.com/intl.asp
> > >
> > >
> >
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>

Reply via email to