#!/usr/bin/perl
# Invisible Tracker
# richard@oakbox.com
# http://www.oakbox.com
# all the normal disclaimers
# Call this script from ANY web page like this
#
#
#
# Add a one pixel by one pixel gif in your CGI-BIN directory called 'one_pixel_gif.gif'
# That's all there is to it!
# Where do you want the results stored?
$tracking_file="tracked.txt";
$page_id=$ENV{'HTTP_REFERER'};
open(RDBK,"<$tracking_file");
@previous=;
close (RDBK);
open(WRBK,">$tracking_file");
foreach $record (@previous){
chomp $record;
@request=split(/\|/,$record);
if($page_id eq $request[0]){
$count=$request[1]; $count++;
print WRBK "$request[0]\|$count\n";
$update="1";}
else {print WRBK "$record\n";}
}
if($update ne "1"){
print WRBK "$page_id\|1 \n";}
close(WRBK);
print "Content-type: image/gif\n\n";
open (BANNER,"one_pixel_gif.gif");
print ;
close (BANNER);