Stop Spam Script – Do not delete

select distinct hostname
from (
SELECT hostname, CAST( FROM_UNIXTIME( TIMESTAMP ) AS DATE ) AS ddd, COUNT( * ) AS hits
FROM accesslog AS a
WHERE uid = 0 and not exists (

SELECT ip
FROM good_bots as b
where a.hostname = b.ip

)

AND NOT
EXISTS (

SELECT *
FROM blocked_ips AS b
WHERE a.hostname = b.ip
)
AND NOT
EXISTS (

SELECT *
FROM accesslog AS b
WHERE b.hostname = a.hostname
AND b.uid <>0
)
GROUP BY hostname, CAST( FROM_UNIXTIME( TIMESTAMP ) AS DATE )
HAVING COUNT( * ) >20

) as xxx

“);

?>

This simple PHP script stops unwanted bots from attacking this site. This script is created specifically for malaya.com.ph; by Raymond G.B. Tribdino, 2018 June. 11