#!/usr/local/bin/perl # # $countfile = "nvisitas.txt"; $logfile = "visitas.txt"; $giffile = "small.gif"; $count = `cat $countfile`; chop($count); $count = $count + 1; $datec="date"; $date = `$datec +"%A, %B %d, %Y at %T (%Z)"`; chop($date); open(INF,">$countfile"); print INF "$count\n"; close(INF); open(vis,">>$logfile"); print vis $ENV{'REMOTE_ADDR'}." ".$date." ".$ENV{'TZ'}." ".$ENV{'HTTP_USER_AGENT'}."\n"; close(vis); # if you're using a JPEG instead of a GIF, you should change this # line to print type image/jpg. print "Content-type:image/gif\n\n"; @gifdata = `cat $giffile`; print @gifdata; # the end.