Hi all,

My first question is a little off the beaten track. I'm writing some web
counter software at the moment. Basically I use Javascript to embed the
following into a html page:

      <script language="javascript">
        <!--
          d = document;
          now = new Date();

          function pr() {
            d.write( "<p>Page: " + d.URL, " Referrer: " + d.referrer +
"</p>");
            d.write( "<img
src=\"http://localhost/cgi-bin/Hit/bin/register.cgi?page="; + d.URL +
                     "&refr=" + d.referrer + "&date=" + now + "\"
width=1 height=1>" );
          }

          pr();
        //-->
      </script>

My register.cgi instantiates a Hit object and then logs it for later
analysis, then returns a token image to satisfy the img tag:

# Register the Hit.
my $page     = $q->param( "page" );
my $referrer = $q->param( "refr" );

if ( HitGlobals::DEBUG ) {
    foreach my $name ( $q->param ) {
        print FD "$name: \n";
        foreach my $value ( $q->param( $name )) {
            print FD "  $value\n";
        }
    }
}

if ( not $page eq "" ) {

    my $hit = Hit->new();
    $hit->page( $page );
    $hit->referrer( $refr );
    $hit->browser( $ENV{ "HTTP_USER_AGENT" } );
    $hit->Print( \*FD );
    $hit->register();
}


Anyway, it all works fine until I test with IE, which doesn't set the
HTTP_REFERER variable. Now depending on which side of Uncle Bill's fence
you sit on, this is either a very annoying bug, or an extra security
feature...

My CGI pages just access the HTTP_REFERER, REQUEST_URI and
HTTP_USER_AGENT directly so they are fine.

Without getting into any slinging matches, I'm wondering whether there
is any way to get around this without having to turn all my static html
pages into CGI.

Cheers

Mike



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to