httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Turner <kk...@sbcglobal.net>
Subject Re: [users@httpd] logging banner ads in customer's apache logs
Date Fri, 17 Jan 2003 21:42:48 GMT
Thomas Moore wrote:

>
>I want to log banner ads in my mySQL database (which I am doing now), and
>then have the link jump to the customers web site (which I am doing now
>using META HTTP refresh).
>
>The problem is we want the customer to see that his link was clicked on by
>our web server and it seems like using the META refresh puts the log data
>into "no referer" for his web logs instead of our domain name.

No PHP here, so a Perl example.

===============================

#!/usr/bin/perl -wT

use strict;

# The idea here is to let the browser go to a new url while a record
# is made of the click through.

my $path = $ENV{QUERY_STRING};
print "Location: $path\n\n";

====================================

This causes the browser to go to the address in $path.  Some older
browsers may not support "Location".  For that, you could also return a
page with a normal <a href>.

and, sample html

====================================

<html> <head>
<title>redirection test</title>
</head>

<body>
<h1>Let's Track a Click-Thru</h1>

<a href="cgi/go.pl?http://debian.org/">Debian</a>
<br>

<a href="cgi/go.pl?http://netscape.com/">netscape</a>
<br>

<hr>

==================================

Your access log will have the clicked-through site in the GET string.
At the same time, your customer will see a referer from the client.  How
you parse the logs is another exercise.  This should provide enough for
billing and the customer can compare to his access and referer logs if
he wishes.  If his logs show you as referer, might he suspect you of
running up the count?
--
gt                  kk5st@sbcglobal.net
 If someone tells you---
 "I have a sense of humor, but that's not funny." 
                                  ---they don't.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message