Forum Moderators: martinibuster
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 ;))
<?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);
}
?>