Forum Moderators: martinibuster

Message Too Old, No Replies

Adsense logger for Mozilla/Firefox?

Implementing the click logged discussed earlier this year

         

JeroenK

2:58 pm on Aug 31, 2005 (gmt 0)

10+ Year Member



Hey Everyone,

Just to be in stronger shoes whenever I see a click-attack on my site (able to filter out the IP's), I decided to add the javascript/php solution as discussed earlier this year on:

[webmasterworld.com...]

Was able to make a nice little PHP script to go with it as well, which will write all into a TXT file.

There was some notion of this problem in the thread, but I enever saw anyone returning back to it, or offering any solutions to this: the script does not seem to work at all with the latest Firefox. I can only assume it will not work with other versions of FF and perhaps Mozilla suite as well.

Has anyone resolved this issue? If so How? Is it even possible to log clicks in Firefox, regarding the Javascript code from above thread is using a non-standard way to log the clicks? (heh, for once I wished FF wouldnt be so strict about standards ;))

Seige

3:55 pm on Aug 31, 2005 (gmt 0)

10+ Year Member



PHP script? Really? Care to share it with us here?

I'd like to implement it into my MySQL Database too, since the textfile gets too large, troublesome and difficult to manage.

JeroenK

5:30 pm on Aug 31, 2005 (gmt 0)

10+ Year Member



Well, reading your post it says to me you already have a php script that writes it all into a TXT file, but here you go:

<?php
$r = $_GET['R'];
$u = $_GET['U'];
$IP = $_SERVER["REMOTE_ADDR"];
$adsenseBrowser = $_SERVER["HTTP_USER_AGENT"];
$adsenseTime = date("Y m d");
$adsenseLine = "\n" . $r . "¦" . $u . "¦" . $IP . "¦" . $adsenseBrowser . "¦" . $adsenseTime;
$adsenseClicks = 'path/to/adsenseClicks.txt';
if (is_writable($adsenseClicks)) {
if (!$handle = fopen($adsenseClicks, 'a')) {
print "Cannot open file ($adsenseClicks)";
exit;
}
// Write $newline to our opened file.
if (!fwrite($handle, $adsenseLine)) {
print "Cannot write to file ($adsenseClicks)";
exit;
}
fclose($handle);
}
?>

jema

5:56 pm on Aug 31, 2005 (gmt 0)

10+ Year Member



People might be interested in this:

[forum.opensourcematters.org...]