Forum Moderators: martinibuster
<?php
$handle = @fopen("/var/log/httpd/access_log", "r"); // Open file form read.
if ($handle) {
while (!feof($handle)) // Loop til end of file.
{
$buffer = fgets($handle, 4096); // Read a line.
if(preg_match('/GET \/images/',$buffer, $matches)) {
// This is my list of acceptable sites. If not in the list, then it is a non-approved hot lister.
if(preg_match('/customvictorymotorcycleparts|myklr650|kingpincruisers|cyclesolutions|google|ebay|aitsafe|\"-\"/i',$buffer, $matches)) {
// skip this record since it is an acceptable site.
} else {
echo $buffer;
}
}
}
fclose($handle); // Close the file.
}
?> [edited by: janoss at 3:18 am (utc) on Nov 8, 2010]