sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
I've tried to write a script that records the referring URL but it keeps up coming Unknown. I automatically set blank $ENV{HTTP_REFERER}s to Unknown just so that data isn't wasted.
Since I've installed the script, I've had 53 vistors, ALL have showed up as Unknown. Just to test things out I added a link to my website on my homenode, but that came back as Unknown as well.
Did I goof something up in the script below?
my %list; my $list = "refer.dbm"; my $file = "refer.txt"; print header, start_html; tie %list, 'SDBM_File', $list, O_CREAT | O_RDWR, 0644; if ( !tied %list ) { print "database unsuccessful $!.\n"; } my $ip = $ENV{REMOTE_ADDR}; my $location = $ENV{HTTP_REFERER}; if ( exists $list{$location} ) { my $value = $list{$location}; $value++; $list{$location} = $value; } elsif ( $list{$location} eq "" ) { if ( exists $list{Unknown} ) { my $value = $list{Unknown}; $value++; $list{Unknown} = $value; } else { $list{Unknown} = "1"; } } else { $list{$location} = "1"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $ENV{HTTP_REFERER}; not showing up
by Gerard (Pilgrim) on Dec 09, 2003 at 03:57 UTC | |
|
Re: $ENV{HTTP_REFERER}; not showing up
by davido (Cardinal) on Dec 09, 2003 at 05:23 UTC | |
|
Re: $ENV{HTTP_REFERER}; not showing up
by Roger (Parson) on Dec 09, 2003 at 05:39 UTC | |
by sulfericacid (Deacon) on Dec 09, 2003 at 16:30 UTC | |
|
Re: $ENV{HTTP_REFERER}; not showing up
by edoc (Chaplain) on Dec 09, 2003 at 05:15 UTC |